I would like to know if I'm using floats in the right way (efficiently) in this code bellow.
There are basically 3 columns (with float left, left and right assigned respectively). Am I using too many floats? Will this cause me problems if I add or delete columns?
This is my index.html:
<div id="content">
<div id="left-column">
<h2>left-column</h2>
<p>
erat, nec semper dui diam ut libero. Donec adipiscing placerat metus.
Integer eu eros vel risus ornare consequat. Curabitur sem erat, tempor
</p>
</div>
<div id="main-column">
<h2>main-column</h2>
<p>
erat, nec semper dui diam ut libero. Donec adipiscing placerat metus.
Integer eu eros vel risus ornare consequat. Curabitur sem erat, tempor
</p>
</div>
<div id="right-column">
<h2>right-column</h2>
<p>
erat, nec semper dui diam ut libero. Donec adipiscing placerat metus.
Integer eu eros vel risus ornare consequat. Curabitur sem erat, tempor
</p>
</div>
</div>
This is my style.css:
#navigation {
font-family: Trebuchet MS;
font-weight: bold;
color: #FFF;
width: 900px;
background-color: #000;
overflow: hidden;
}
#left-column {
margin: 10px 10px 0 0;
width: 150px;
padding: 10px;
float: left;
color: #FFF;
background-color: #A53030;
}
#main-column {
width:410px;
padding: 10px;
float: left;
}
#right-column {
width: 260px;
padding: 10px;
float: right;
}
#footer {
margin-top: 10px;
padding: 5px;
width: 900px;
border-color: #262626;
border-top-style: solid;
border-width: medium;
clear: both;
}
I added clear: both in the footer because I've seen this in many webpages but I'm not sure why is there because nothing happens if I delete it.