This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Stylesheets > November 2005 > Margin in <body>





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Margin in <body>
Greg Heilers

2005-11-13, 3:21 am


Perplexing problem: All of a sudden, the code I am tinkering with; renders
a white-space margin around all four edges of the browser window (Mozilla,
Firefox, Konqueror, and Opera). I can not figure out why. Here is the
section from the style sheet:



body {
margin:0;
color:#002200;
background-color:#eeeeee;
font-size:1.0em;
}


No matter what little thing I change, the unwanted margin keeps appearing.
So, I tried an "old" method, using the <body> tag:

<body topmargin="0" marginwidth="0" marginheight="0" leftmargin="0">

Now, *this* works, in eliminating the unwanted margin. Why is the code
within the style sheet not working? Has anyone ever suffered from this
situation?

--

Greg Heilers
Registered Linux user #328317 - SlackWare 10.1 (2.6.10)
.....

Why did this have to happen now, during prime time, when TV's
brightest stars come out to shine?

-- Homer Simpson
Brother Can You Spare Two Dimes?

Barbara de Zoete

2005-11-13, 3:21 am

On Sun, 13 Nov 2005 07:52:07 +0100, Greg Heilers
<gNOSPAMheilers@earthNOSPAMlink.net> wrote:

> Perplexing problem: All of a sudden, the code I am tinkering with;
> renders
> a white-space margin around all four edges of the browser window
> (Mozilla,
> Firefox, Konqueror, and Opera). I can not figure out why. Here is the
> section from the style sheet:
>


Isolated bits of code don't work for me in this case, since my cristal
ball is at the shop for an update. Please provide a URL.


--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
meltedown

2005-11-13, 3:21 am

Greg Heilers wrote:
> Perplexing problem: All of a sudden, the code I am tinkering with; renders
> a white-space margin around all four edges of the browser window (Mozilla,
> Firefox, Konqueror, and Opera). I can not figure out why. Here is the
> section from the style sheet:
>
>
>
> body {
> margin:0;
> color:#002200;
> background-color:#eeeeee;
> font-size:1.0em;
> }
>
>
> No matter what little thing I change, the unwanted margin keeps appearing.
> So, I tried an "old" method, using the <body> tag:
>
> <body topmargin="0" marginwidth="0" marginheight="0" leftmargin="0">
>
> Now, *this* works, in eliminating the unwanted margin. Why is the code
> within the style sheet not working? Has anyone ever suffered from this
> situation?
>

When I get a style that mysteriously doesn't work, its usually a syntax
mistake in the style sheet. Try moving the body style to the very top of
the sheet. If it works, then move it down the sheet until it stops
working. Then look just above that code for a syntax error. It doesn't
take much. Or post the whole stylesheet, if its not too big.
Michael Fesser

2005-11-13, 6:51 pm

..oO(Greg Heilers)

>Now, *this* works, in eliminating the unwanted margin. Why is the code
>within the style sheet not working?


body {
margin: 0;
padding: 0
}

Micha
Gus Richter

2005-11-13, 6:51 pm

Greg Heilers wrote:
> Perplexing problem: All of a sudden, the code I am tinkering with; renders
> a white-space margin around all four edges of the browser window (Mozilla,
> Firefox, Konqueror, and Opera). I can not figure out why. Here is the
> section from the style sheet:
>
>
>
> body {
> margin:0;
> color:#002200;
> background-color:#eeeeee;
> font-size:1.0em;
> }
>
>
> No matter what little thing I change, the unwanted margin keeps appearing.
> So, I tried an "old" method, using the <body> tag:
>
> <body topmargin="0" marginwidth="0" marginheight="0" leftmargin="0">
>
> Now, *this* works, in eliminating the unwanted margin. Why is the code
> within the style sheet not working? Has anyone ever suffered from this
> situation?
>


Opera sets a default padding value to body.
Mozilla and IE set a default margin value to body.

--
Gus
kchayka

2005-11-13, 6:51 pm

Gus Richter wrote:
>
> Opera sets a default padding value to body.
> Mozilla and IE set a default margin value to body.


There is also default margin/padding on the html element.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Gérard Talbot

2005-11-14, 4:19 am

kchayka a écrit :
> Gus Richter wrote:
>
>
>
> There is also default margin/padding on the html element.
>


There is no default margin/padding on the html element for Mozilla and
for IE.

Gérard
--
remove blah to email me
Gérard Talbot

2005-11-14, 4:19 am

Gus Richter a écrit :
> Greg Heilers wrote:
>
>
> Opera sets a default padding value to body.


Opera 9.0 beta 1 removed padding value and implemented an 8px margin on
the body node, just like Mozilla.

Gérard
--
remove blah to email me
Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews