DIV width problem, 100%

K

kurt sune

I have the following code in an ASPX- page:

<DIV id="header" style="Z-INDEX: 102"></DIV>

I render it using a CSS:

#header {

background: #0D3D91;

position: absolute;

top: 0px;

left: 0px;

right: 0px;

width: 100%;

height: 18px;

overflow:hidden;

}



Problem:

The DIV doesnt fill the entire width of the browser window. (IE6.0).

However if I set width = 110% it works.



Does somebody know why 100% sometimes isnt 100%?
 
L

Leon Mayne [MVP]

kurt said:
The DIV doesnt fill the entire width of the browser window. (IE6.0).
However if I set width = 110% it works.

Does somebody know why 100% sometimes isnt 100%?

Have you tried not positioning it absolutely?
Otherwise, is it within another element (e.g. a table or another div) that
isn't set to 100%?
 
L

Leon Mayne [MVP]

kurt sune wrote:

<snip>

Just tried it. Try getting rid of the:
left: 0px;
right: 0px;
attributes in the CSS.
 
K

kurt sune

Setting position to relative doesnt change it becoming to short.

I have only this code in the page in a ascx:
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="HeaderUC.ascx.vb" Inherits="SimplePageInherit.HeaderUC"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<DIV id="header" style="Z-INDEX: 102"></DIV>
<DIV id="header2" style="Z-INDEX: 103"></DIV>
<DIV id="header3" style="Z-INDEX: 101"></DIV>
It becomes too short also when I put the code in a web custom control.

It works when the HTML is placed directly in the aspx.

/k
 
K

kurt sune

Correction:

by removing
left: 0px;
right: 0px;

it becomes to short both left and right.if the code is in a web custom
control

it becomes to short left if the code is in an ascx

/k
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top