Right margin in IE?

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 ...



Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs/Using_Web_Standards_in_ your_Web_Pages

Re: Right margin in IE?

am 11.05.2007 18:56:34 von Hans-Peter Sauer

"Gérard Talbot" wrote in message
news:134544kbnt7d1f8@corp.supernews.com...
> 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

>> --
>> 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 ...
>
>
>
> Gérard
> --
> Using Web Standards in your Web Pages (Updated Dec. 2006)
> http://developer.mozilla.org/en/docs/Using_Web_Standards_in_ your_Web_Pages

Hi Gérard,

I copied the code you've supplied to this test page:
http://www.felston.com/temp/test2.html
and it produces a background colour of grey (#CCC) that extends to the
corners of the screen with no 10px margin. That's not what I was after in
fact. I know I did not specify that requirement in my original text, sorry.
The code with the wrapper as suggested by BootNic is doing what I want as
shown here http://www.felston.com/temp/test.html If that can be achieved
without the extra wrapper div then I would be very happy to implement it
that way, thanks.

--
James

Re: Right margin in IE?

am 11.05.2007 19:50:52 von a.nony.mous

James A wrote:

> I copied the code you've supplied to this test page:
> http://www.felston.com/temp/test2.html

Looks normal to me.

> shown here http://www.felston.com/temp/test.html

My ugly orange default background color shows around the edges. Not
pleasant. Not everyone has a default white background.

--
-bts
-Motorcycles defy gravity; cars just suck

Re: Right margin in IE?

am 12.05.2007 04:43:13 von BootNic

> James A wrote:
> news: 6f11i.10871$J81.7418@newsfe4-gui.ntli.net
[snip]
>>
> The code with the wrapper as suggested by BootNic is doing what I
> want as shown here http://www.felston.com/temp/test.html If that
> can be achieved without the extra wrapper div then I would be
> very happy to implement it that way, thanks.

I did not suggest any HTML content at all, I did suggest some css that
would produce the effect I believed you wanted, with your HTML.

Adding a background color to the html in the example Gérard provided
may produce the effect you desire.

--
BootNic Friday, May 11, 2007 10:43 PM

All my humor is based upon destruction and despair. If the whole
world was tranquil, without disease and violence, I'd be standing on
the breadline right in back of J. Edgar Hoover.
*Lenny Bruce US comedian, satirist, author*