Consider this structure.
<body>
<div id="wrapper">
</div>
</body>
<div id="wrapper">
</div>
</body>
CSS Property:
body {
text-align: center;
min-width: 600px;
background:green;
}
#wrapper {
margin:0 auto;
width:600px;
text-align: left;
background:red;
height:100px;
}
text-align: center;
min-width: 600px;
background:green;
}
#wrapper {
margin:0 auto;
width:600px;
text-align: left;
background:red;
height:100px;
}
The technique will center the DIV because
we are setting the margins to auto, web browsers are required by the CSS standard to give them equal width from both sides.
No comments:
Post a Comment