![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I want to be able to have a div which occupies the full width of the browser window, but taking into account margin for that div. I've tried using width: 100% ; margin 1 em ; properties for the div, but the right hand edge of the div insists on touching the right hand edge of the browser window even though the margin should be 1em. It seems to do this both in netscape 7.1, and ie6. Am I trying to do something that cannot be done ? |
#2
| |||
| |||
|
|
Tony Benham wrote: I want to be able to have a div which occupies the full width of the browser window, but taking into account margin for that div. I've tried using width: 100% ; margin 1 em ; properties for the div, but the right hand edge of the div insists on touching the right hand edge of the browser window even though the margin should be 1em. It seems to do this both in netscape 7.1, and ie6. Am I trying to do something that cannot be done ? Remember that "width" is "width of content" not "width of content + padding + border + margin". { margin: 1em; padding: 0; border-width: 0; width: auto; } |
#3
| |||
| |||
|
|
Tony Benham wrote: the content in some cases is not going to be the width of the browser window, but I still would like the div to expand to the width of the browser window (minus the margin at lh/rh/top/bottom edges) ? That happens normally with block level boxes, doesn't it? |
![]() |
| Thread Tools | |
| Display Modes | |
| |