Right margin in IE?
am 08.05.2007 23:21:48 von Hans-Peter Sauer
Hi,
I'm trying to create a 10px wide margin on the left and right of a page
using CSS. Those margins need to be 10px whatever the width of the page.
Firefox and Opera work fine, but in IE6 the right hand side has no margin
and a horizontal scroll bar appears as the page is a little wider than the
window (10px maybe). My test page is here:
http://www.felston.com/temp/test.html
And the code is:
"http://www.w3.org/TR/html4/strict.dtd">
Test
"content" just represents the content of the page that I will add later.
From reading another usenet post, I believe the issue is that IE has no
reference to use with "right". But I can't find a solution. I tried
replacing the left and right with margin-left and margin-right, which again
works fine with Firefox and Opera, but produces the same no right margin
result with IE6.
Could someone please offer a solution that works with IE? Many thanks!
--
James
Re: Right margin in IE?
am 09.05.2007 00:50:58 von BootNic
> James A wrote:
> news: MR50i.7538$H4.1595@newsfe2-gui.ntli.net
> Hi,
>
> I'm trying to create a 10px wide margin on the left and right of a
> page using CSS. Those margins need to be 10px whatever the width of
> the page. Firefox and Opera work fine, but in IE6 the right hand side
> has no margin and a horizontal scroll bar appears as the page is a
> little wider than the window (10px maybe). My test page is here:
> http://www.felston.com/temp/test.html
[snip]
>
[snip]
> Could someone please offer a solution that works with IE? Many thanks!
--
BootNic Tuesday, May 08, 2007 6:50 PM
When men are pure, laws are useless; when men are corrupt, laws are
broken.
*Benjamin Disraeli*
Re: Right margin in IE?
am 09.05.2007 09:35:52 von Hans-Peter Sauer
"BootNic" wrote in message
news:m970i.9231$j63.798@newsread2.news.pas.earthlink.net...
>> James A wrote:
>> news: MR50i.7538$H4.1595@newsfe2-gui.ntli.net
>> Hi,
>>
>> I'm trying to create a 10px wide margin on the left and right of a
>> page using CSS. Those margins need to be 10px whatever the width of
>> the page. Firefox and Opera work fine, but in IE6 the right hand side
>> has no margin and a horizontal scroll bar appears as the page is a
>> little wider than the window (10px maybe). My test page is here:
>> http://www.felston.com/temp/test.html
[snip]
>
>
>
> --
> BootNic Tuesday, May 08, 2007 6:50 PM
>
> When men are pure, laws are useless; when men are corrupt, laws are
> broken.
> *Benjamin Disraeli*
>
That's superb! Many thanks BootNic. Working perfectly.
--
James
Re: Right margin in IE?
am 09.05.2007 15:37:22 von lws4art
James A wrote:
> "BootNic" wrote in message
> news:m970i.9231$j63.798@newsread2.news.pas.earthlink.net...
>>> James A wrote:
>>> news: MR50i.7538$H4.1595@newsfe2-gui.ntli.net
>>> Hi,
>>>
>>> I'm trying to create a 10px wide margin on the left and right of a
>>> page using CSS. Those margins need to be 10px whatever the width of
>>> the page. Firefox and Opera work fine, but in IE6 the right hand side
>>> has no margin and a horizontal scroll bar appears as the page is a
>>> little wider than the window (10px maybe). My test page is here:
>>> http://www.felston.com/temp/test.html
> [snip]
>>
>>
And the moral of this story... "Do not use absolute positioning until
you full understand what it means..."
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Re: Right margin in IE?
am 10.05.2007 05:25:00 von newsblahgroup
James A a écrit :
> Hi,
>
> I'm trying to create a 10px wide margin on the left and right of a page
> using CSS. Those margins need to be 10px whatever the width of the page.
> Firefox and Opera work fine, but in IE6 the right hand side has no margin
> and a horizontal scroll bar appears as the page is a little wider than the
> window (10px maybe). My test page is here:
> http://www.felston.com/temp/test.html
>
> And the code is:
>
>
> "http://www.w3.org/TR/html4/strict.dtd">
>
>
>
> Test
>
>
>
>
>
>
>
>
>
> "content" just represents the content of the page that I will add later.
>
> From reading another usenet post, I believe the issue is that IE has no
> reference to use with "right". But I can't find a solution. I tried
> replacing the left and right with margin-left and margin-right, which again
> works fine with Firefox and Opera, but produces the same no right margin
> result with IE6.
>
> Could someone please offer a solution that works with IE? Many thanks!
>
> --
> James
Why do you first remove the default margin of the body, then create an
unneeded, non-necessary DOM node duplicating the function of the body
and then set some absolute positions that exactly equate and act like
margins on the body? All of what you are trying to do could be done by
simply redefining the default margins on the body, and that, without a
wrapper div and without absolute positioning.
.... content ...