tags:

views:

32

answers:

2

Hello,

This may sound silly.

I have a <div style="position:absolute; top:0px; left:0px; width:100%; height:200px; background-color:#222222; margin-bottom:50px; right:0px;"></div>. It shows up from left to right on ff and chrome, but not IE. How exactly should be resolved.

Thanks Jean

A: 

In IE, you need to make sure the parent element has a width set. If the parent is the body tag, just give it the same 100% width value:

body {
    width: 100%;
}

or using style attributes only:

<body style="width:100%;">
  <div 
    style="left:0px; width:100%; top:0px; position:absolute; background-color:#000">
  </div>
</body>
Andy E
I want to be able to set up a div, to be 100%, so the body with width tag will not help
Jean
@Jean: I don't think you understand what I mean. The parent element of your 100% wide div **also** needs to have `width` defined in IE. I was just using `body` as an example.
Andy E
Here is my div<div style="position:absolute; top:0px; left:0px; width:100%; height:200px; background-color:#222222; margin-bottom:50px; right:0px;"></div>
Jean
tried this<style>body{width:100%;}</style>does not work
Jean
+2  A: 

Try setting right in addition to left:

position:absolute;
top:0;
left:0;
right:0;
RegDwight
did right:0px, does not work
Jean
This is my <div><div style="position:absolute; top:0px; left:0px; width:100%; height:200px; background-color:#222222; margin-bottom:50px; right:0px;">
Jean