Take the 2-minute tour ×

I have a css code that has a float property. When i resize the window of my browser, the menus of my webpage are moving down. I already comment-out the float properties, but nothing's changed. What should I do to make it fixed that it will not move down even though I resize my browser?

share|improve this question
add comment

1 Answer

float got nothing to do with the floating of the div's when the window is resized.

It just ask the div to be aligned to the left,right only if there is space,

what i think you should do is to make wrapper div ID called "content" like this below and add all your inside div elements there,

margin:0px auto;

now inside this div content, if you have 2 div's width 400px and 400px if you set their property to float left they align left, if you set it float right they align right..

if there is no space, like if one div is 400px and other one is 600px even if the property is set to float left they will come as vertical dives as combined width is more than container div

learn more about fix width css design

share|improve this answer
add comment

Your Answer


