I'm doing a homework for university is to make a website. So i have a div id named container that is my div that will define the width for all my page. So my question is the teacher said to put
#container {
width:Anyvaluepx;
margin:auto;
}
So i was looking for ways to center a container and i saw people saying to put something like that:
#container {
width:valuepx;
margin 0 auto;
}
I think is not necessary my html file but i will post too:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Eagle's Guitar Shop</title>
<link rel="stylesheet" type="text/css" href="css/styles.css" />
</head>
<body>
<div id="container">
<div id="header">
</div>
<div id="nav">
</div>
<div id="content">
</div>
<div id="footer">
</div>
</div> <!--Finish Container div-->
</body>
</html>
So my question is simple what is the difference between use margin:auto; and margin: 0 auto;?
Thanks for all the question so the margin works for re-size the website with the screen resolution right? so it is better to let all auto? or 0 auto;?
Thank you for your time.