Note that there are some explanatory texts on larger screens.

plurals
  1. PODifficulty when trying to size Div's in An XP environment. under IE8
    primarykey
    data
    text
    <p>I am trying to understand a problem in my web development. I am developing in an XP environment with IE 8. To get to the route of the problem, I developed a very simple web page.<br> It basically consists of two elements. A body (with a red background) and a Div (with a green background). I set the height of the div to 100%. I would expect the div to fill the page since both height and width are 100%. But instead I get a thin div, maybe half a cm in height that stretches nearly to the left and right edges of the page. If I specify the height of the div as an absolute number of pixels (e.g. 512px) I can increase the height of the div. But this is not going to work for me since I need to accommodate users with different screen resolutions. There is something fundamental that I am not getting here. Can someone help me? </p> <p>Here is the content of the page:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /&gt; &lt;title&gt;TEST&lt;/title&gt; &lt;link href="css/stylesheet.css" type="text/css" rel="stylesheet" media="all"/&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="container"&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And here is the style sheet associated with the page. </p> <pre><code> body { text-align:center; background-color:red; } #container { width:100%; height:100%; background-color:green; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload