Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS Clear within float based columns?

Tags:

css

css-float

I'm floating a sidebar to the left of the main content panel. Then inside that panel, I have a number of boxes, which are floated and cleared in order to create a sort of grid (it's a "my account" page, with various boxes containing things like orders, edit details etc). The problem is that the boxes inside the content div are clearing against the sidebar, as opposed to just the other boxes in that div. There's a link to an image below if that explanation was confusing:

enter image description here

Has anyone come across this before, and if so, do you know a fix for it? I'm probably going about this the wrong way, but I learnt CSS almost entirely from trial and error, so my knowledge of the theory of it is most likely woefully lacking.

like image 923
Jim Avatar asked Nov 14 '22 08:11

Jim


1 Answers

If the content panel isn't floated, any elements inside will clear the sidebar float. Easy solution would be to float the content panel. Since you haven't posted html/css it's hard to really see the issue, though, and provide any suggestions for if you don't want to float the content panel.

Before

After

like image 71
meder omuraliev Avatar answered Dec 19 '22 00:12

meder omuraliev