Hacked Files
Hacked Files

Reputation: 99

CSS Floating Divs and Footer?

I have this:

enter image description here

So like you see, two floating divs at the top and a solid div at the bottom. But the solid div (footer) hides under the two floating divs.

How can I make it so it stays under the two floating divs and not in them like on the imgur?

.left {
  float:left;
  width:300px;
}
.right {
  float:right;
  width:300px;
}
.footer {
  width:600px;
}

Upvotes: 1

Views: 65

Answers (2)

davbuc
davbuc

Reputation: 537

just add clear:both; to your .footer in css to clear the floats.

for more info see this fiddle:

http://jsfiddle.net/1wz2bud1/

.footer {
  width:600px;
  clear: both; 
}

Upvotes: 0

j08691
j08691

Reputation: 208032

Add clear:both; to the footer rules.

.footer {
  width:600px;
  clear:both;
}

https://developer.mozilla.org/en-US/docs/Web/CSS/clear

Upvotes: 1

Related Questions