I want a CSS layout where there is a side-bar on the left-hand side which is 100px. The entire web page must be 400 px wide. What are the pros, cons and general differences between the following different methods?
Method 1
#container {
width: 400px;
}
#left {
float: left;
width: 100px;
}
#main {
float: left;
width: 300px;
}
Method 2
#container {
width: 400px;
}
#left {
float: left;
width: 100px;
}
#main {
display: block;
margin-left: 100px;
}
You should go with method number 1,
and assuming #main is a div, it already has a property of display:block; by default.