Tuesday, August 16, 2011

How to center your Div tag on CSS

Here is the code for CSS

Ex.

#container {
                   width: 800px;
                   height: 900px;
                   margin-left: auto;
                   margin-right: auto:
}
The AUTO word means that it automatically center your div.

Here is the code for HTML

Ex.

<div id="container">
<div id="banner"></div>
</div>

You must put the div tag inside the div container so the banner automatically go to center.

That's all.
Thanks !

No comments:

Post a Comment