SolutionCottage.com
Posted  10 Dec 2008 - 22:51:07

Category: CSS


Center div on page

Issue:
You want to have a centered container with content on a website.

Solution:
Depending on what's inside the container you're building, you might need to nest containers. Here is a fast example on how to center a div layer on a page:

body {
margin:50px 0px;
padding:0px;
text-align:center;
}


#container{
width:600px;
margin:0px auto;
text-align:left;
padding:15px;
border:1px solid #666;
background-color:#ccc;
}



Marked as helpful by 1 user




0 comments:








© SolutionCottage 2008-2011 7/21/2017 3:30:56 AM