One of the great features of web development is that most often when you see a site and think, “How did they do it,” it’s very easy to look at the code and find out, as well as check it - tools like Firebug for Firefox, tools developers in IE 8 (F12) and Chrome will display well-formatted source and CSS and will let you change it in place.
In the case of SO, the main site object is contained in a div with the class "container", the style rules for "container" are:
.container {
margin: 0 auto;
text-align: left;
width: 950px;
}
The key value that we are considering here is that this class has a fixed width of 950 pixels, and the fields are set (expanded):
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
"" div , 950px.
div div id "content" ( ), div: "mainbar" "sidebar", :
#mainbar {
float: left;
margin-bottom: 40px;
width: 715px;
}
#sidebar {
float: right;
width: 220px;
- , .
CSS:
clear
"", "" "", reset .
, , , " Holy Grail of CSS" ( , IE7, . ) : , .
: