...

View Full Version : Problem with DIV width



Baswazz
05-12-2010, 01:43 PM
Hello All,

When you check the example: www.picoba.nl/123/index22.html
You see a simple layout.



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
background-color: #666;
margin: 0px;
}
#frame {
background-color: #CCC;
height: 500px;
width: 100%;
margin: 0px;
}
#frame2 {
background-color: #FFF;
height: 400px;
width: 700px;
margin-right: auto;
margin-left: auto;
border: 1px solid #000;
top: 40px;
position: relative;
}
</style>
</head>

<body>
<div id="frame">
<div id="frame2"></div>
</div>
</body>
</html>


But now my problem; when i resize the browser window, firefox, IE, safari etc. And i make it a width of 10/15cm.
You see a horizontal scrollbar appear. when you scroll to the right, you will see what i mean.

frame div does not stay 100% width.

http://www.picoba.nl/123/11.52.01.png

optimus203
05-13-2010, 03:34 AM
Have you tried: html {overflow-x: hidden;}

or try placing the overflow-x:hidden; style on your frame.

axtonjdl08tp
05-13-2010, 07:30 AM
I also have this problem


Regards
oak furniture (http://www.fourcornerstrading.co.uk)

Baswazz
05-13-2010, 10:10 AM
Have you tried: html {overflow-x: hidden;}

or try placing the overflow-x:hidden; style on your frame.

Glad i am not the only one having this problem.

I tried it in the #frame. That does fix it in some way, i found out myself that set; #frame to position: fixed;
Does the same.
But i am more looking for a solution that when i make my browser window smaller, that like now, a horizontal scrollbar appear. But that that my width: 100%; stays 100%

Also i can add; overflow-x: auto; to #frame then when i resize my browser window a scrollbar appear in #frame But i don't like that.
And when i add; overflow-x: auto to my body tag the problem appear again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum