
Ok, for my first post I'll start of with something really easy that I used to always cheat and use a table for - centering a div with css. Its very straighforward.
Here is the css - the most important line here is the margin:auto line in the background style. See the attached screenshot for how this looks. I actually used this code for a site, so I left the white border in this example as it adds a nice effect.
body {
background-color:#373b44;
color:#650b0b;
margin-top:25px;
}
#background {
width: 800px;
height:520px;
margin: auto;
background-color: #c0c0c0;
border:3px solid #ffffff;
}
The html page just has the call to the class to achieve the effect
div id="background"
No comments:
Post a Comment