PDA

View Full Version : Float Window resize problem



rukix1x
23 May 2010, 08:49 AM
I have a problem with CSS. Everytime I resize the browser window or change the screen resolution, the floated divs disappear when the window gets smaller. Same when the screen resolution gets smaller. I need help. Thanks. I'm currently having problems when it comes to laying out my page that fits on any resolution.

Wickham
24 May 2010, 01:06 AM
Simplest solution is to make your page fixed width and put it all inside a #wrap div:-

CSS


#wrap { position: relative. width: ???px; margin: 0 auto; }


HTML markup:-


doctype here
<html>
<head>
Head section
</head>
<body>
<div id="wrap">
All page html here
</div>
</body>
</html>


Remember to include a doctype as the first item of your HTML page code from here:-
http://www.w3.org/QA/2002/04/valid-dtd-list.html

The #wrap div width should be the total widths of all you divs in the same line plus all their side margins, side padding and side borders.