473,498 Members | 1,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

body margins....

when I test my stuff with the validator in HomeSite it tells me the body
tag no longer reads margin attributes.. does this mean now margins are
to be specified only in CSS?

I work for an internet co., they support IE 5+ and the old pre-6
Netscape..

if you don't put this tag in html docs, what version of HTML does it
default to?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
(just wondering... because the HomeSite debugger always says that
such-and-such is longer valid in "currently active versions" (of HTML, I
suppose, although it doesn't say...))
thank you..

Frances Del Rio
NYC

Jul 20 '05 #1
9 3711
Frances Del Rio wrote:
when I test my stuff with the validator in HomeSite it tells me the body
tag no longer reads margin attributes.. does this mean now margins are
to be specified only in CSS?
That's preferred, but it depends entirely on which (X)HTML version
you're coding to.
I work for an internet co., they support IE 5+ and the old pre-6 Netscape..
Why not support web browsers in general?
if you don't put this tag in html docs, what version of HTML does it
default to?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
By "it" I presume you mean HomeSite? No idea. You should always declare
a DOCTYPE, and 4.0 Transitional is probably one of the poorer choices
you can make. Try 4.01 Strict instead:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
(just wondering... because the HomeSite debugger always says that
such-and-such is longer valid in "currently active versions" (of HTML, I
suppose, although it doesn't say...))


4.0 Transitional isn't a "currently active version" by my definition.
4.01 Strict is the version to which new pages should be written.

http://tranchant.plus.com/web/html-tutorial/validation

--
Mark.
Jul 20 '05 #2
Frances Del Rio <fd***@yahoo.com> wrote:
when I test my stuff with the validator in HomeSite
Be aware that in technically that is not a validator.
it tells me the body tag no longer reads margin attributes..
They were never valid.
does this mean now margins are to be specified only in CSS?
Yes.
I work for an internet co., they support IE 5+ and the old pre-6
Netscape..
Okay. But does "support" = "must look identical in" ?
if you don't put this tag in html docs, what version of HTML does it
default to?
None (i.e. it's not HTML if it doesn't have a doctype) or HTML 2.0
depending on how you interpret the mess of standards and non-standards
that have been released over the years.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
(just wondering... because the HomeSite debugger always says that
such-and-such is longer valid in "currently active versions" (of HTML, I
suppose, although it doesn't say...))


The 'currently active versions' are just whatever versions you've
configured the Homesite checker to check against. The Homesite checker
doesn't care about the doctype in the document, only about how you've
configured the checker.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #3
On Thu, 01 Jul 2004 10:33:22 -0400, Frances Del Rio <fd***@yahoo.com>
wrote:
if you don't put this tag in html docs, what version of HTML does it
default to?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


Just for your edification, this isn't a tag really. It's simply a
declaration of what kind of code you're using.

And preferable to what you posted above is:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

because in some cases the UA is looking for that match to knock it out of
a quirky mode.
Jul 20 '05 #4
DU
Frances Del Rio wrote:
when I test my stuff with the validator in HomeSite it tells me the body
tag no longer reads margin attributes.. does this mean now margins are
to be specified only in CSS?

Yes. marginheight, marginwidth, topmargin, leftmargin, etc... are not
supported by MSIE 5+ but are supported by NS 4, NS 6, NS 7. So, if you
define these attributes in your document, say, like this:

<body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" ...>
then MSIE 5+ will have 15px of margin for top and bottom of the body
node and a 10px margin for left and right margin while NS 4, NS 6, NS
7.x, Mozilla-based browsers will have 0 margins.

One simple, obvious and reliable benefit of coding according to W3C web
standards is that you avoid all this without even knowing which browsers
and which versions of which browsers support what exactly. You just code
according to W3C web standards and you just let browser manufacturers
update and upgrade their browsers (and they do!) according to web
standards and you invite people to upgrade their browser versions (and
they do!). If you do your part, then your code will be supported and
rendered accordingly thanks to/by other complying parties.

The stupid thing about margins is that NS 4 does support CSS margins
applied to the body; people are still using, relying on invalid code
which really no longer makes any kind of sense.

http://devedge.netscape.com/library/...otes.html#5505
I work for an internet co., they support IE 5+ and the old pre-6 Netscape..

if you don't put this tag in html docs, what version of HTML does it
default to?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
By definition, a valid document requires a doctype declaration. The best
doctype declaration I recommend is using strict HTML 4.01 all the time
because it will trigger standards compliant rendering mode in all
browsers supporting doctype switching that way. In the case of MSIE 6,
this is important because in standards compliant rendering mode, it
corrects an important implementation flaw of the CSS1 box model... and
MSIE 6 is by far the most frequently used on the web.

My Web site is standard! And yours?
http://www.w3.org/QA/2002/04/Web-Quality

List of valid DTDs you can use in your document.
http://www.w3.org/QA/2002/04/valid-dtd-list.html

Don't forget to add a doctype
http://www.w3.org/QA/Tips/Doctype

DU
(just wondering... because the HomeSite debugger always says that
such-and-such is longer valid in "currently active versions" (of HTML, I
suppose, although it doesn't say...))
thank you..

Frances Del Rio
NYC

Jul 20 '05 #5
DU <dr*******@hotWIPETHISmail.com> wrote:
Frances Del Rio wrote:
when I test my stuff with the validator in HomeSite it tells me the body
tag no longer reads margin attributes.. does this mean now margins are
to be specified only in CSS?
Yes. marginheight, marginwidth, topmargin, leftmargin, etc... are not
supported by MSIE 5+ but are supported by NS 4, NS 6, NS 7. So, if you
define these attributes in your document, say, like this:


No. topmargin and leftmargin are supported by IE5+ just as they were
supported by IE4. (top and left were supported from IE2, but IE4 added
right and bottom). IE6 and Opera 7 later added support for left and
top but not right and bottom.

(When only top and left are specified they affect all four margins not
just the top and left ones, I'm not sure if this is true all the way
back to IE2 or whether it's a later change.)

marginwidth and marginheight were added as attributes of body (as
opposed to attributes of frame) by NN4 but are also supported by Opera
4+.
<body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" ...>
then MSIE 5+ will have 15px of margin for top and bottom of the body
node and a 10px margin for left and right margin while NS 4, NS 6, NS 7.x,
Mozilla-based browsers will have 0 margins.
No. MSIE will also display zero margins with the above code. Try it
and see for yourself.
One simple, obvious and reliable benefit of coding according to W3C web
standards is that you avoid all this without even knowing which browsers
and which versions of which browsers support what exactly.
However, you do have to remember that in CSS terms IE and Gecko have
default margins whilst Opera has default padding.
The stupid thing about margins is that NS 4 does support CSS margins
applied to the body;


No it doesn't. Try it and see. The only CSS way of placing content
right up against the window edge in NN4 is absolute positioning.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #6
Steve Pugh <st***@pugh.net> writes:

[NN4]
The only CSS way of placing content
right up against the window edge in NN4 is absolute positioning.


You could as well use negative margins (might be safer e.g. in
combination with scripts, and should not break tabbing through
linkfarms).
--
| ) 111010111011 | http://bednarz.nl/
-(
| ) Distribute me: http://binaries.bednarz.nl/mp3/aicha
Jul 20 '05 #7
DU
Steve Pugh wrote:
DU <dr*******@hotWIPETHISmail.com> wrote:
Frances Del Rio wrote:
when I test my stuff with the validator in HomeSite it tells me the body
tag no longer reads margin attributes.. does this mean now margins are
to be specified only in CSS?
Yes. marginheight, marginwidth, topmargin, leftmargin, etc... are not
supported by MSIE 5+ but are supported by NS 4, NS 6, NS 7. So, if you
define these attributes in your document, say, like this:

No. topmargin and leftmargin are supported by IE5+ just as they were
supported by IE4. (top and left were supported from IE2, but IE4 added
right and bottom). IE6 and Opera 7 later added support for left and
top but not right and bottom.


Ok, I was not sure about these. I'll check this for sure.
(When only top and left are specified they affect all four margins not
just the top and left ones, I'm not sure if this is true all the way
back to IE2 or whether it's a later change.)

marginwidth and marginheight were added as attributes of body (as
opposed to attributes of frame) by NN4 but are also supported by Opera
4+.

<body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" ...>
then MSIE 5+ will have 15px of margin for top and bottom of the body
node and a 10px margin for left and right margin while NS 4, NS 6, NS 7.x,
Mozilla-based browsers will have 0 margins.

No. MSIE will also display zero margins with the above code. Try it
and see for yourself.

One simple, obvious and reliable benefit of coding according to W3C web
standards is that you avoid all this without even knowing which browsers
and which versions of which browsers support what exactly.

However, you do have to remember that in CSS terms IE and Gecko have
default margins whilst Opera has default padding.


That I know.
Despite errors or imprecisions regarding supported attributes, my
reasoning regarding W3C web standards compliance is still very strong:
if you want future-proof code that can now and will later be supported
and rendered in an overwhelming majority of browsers in use out there,
then going with W3C web standards is the safe, solid, reliable way.
The stupid thing about margins is that NS 4 does support CSS margins
applied to the body;

No it doesn't.


Well, I tried setting margins many years ago on NS 4.72 on the body node
and it worked.

Try it and see. The only CSS way of placing content right up against the window edge in NN4 is absolute positioning.

Steve


That could be another issue...not sure what you mean by placing content.
I was referring to rendering of margin for the body node. This reference
supports my claim:

http://devedge.netscape.com/library/...otes.html#5505

DU
Jul 20 '05 #8
DU <dr*******@hotWIPETHISmail.com> wrote:
Steve Pugh wrote:
DU <dr*******@hotWIPETHISmail.com> wrote:

The stupid thing about margins is that NS 4 does support CSS margins
applied to the body;
No it doesn't.


Well, I tried setting margins many years ago on NS 4.72 on the body node
and it worked.


Zero or non-zero margins?
Try it and see. The only CSS way of placing content
right up against the window edge in NN4 is absolute positioning.
That could be another issue...not sure what you mean by placing content.


<body><div>content

I want the content div to be right up in the top left corner with no
space between it and the window frame.
I was referring to rendering of margin for the body node. This reference
supports my claim:

http://devedge.netscape.com/library/...otes.html#5505


Not really, it's very vaguely worded. The only part that would apply
in this case is "Navigator does fairly well".
NN4 is okay so long as you want to increase the default margins of any
element, but as soon as you want to reduce them you often run into
problems.

body {margin: 0; padding: 0;} simply has no effect at all in NN4. Try
it and see.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #9
DU
Steve Pugh wrote:
DU <dr*******@hotWIPETHISmail.com> wrote:
Steve Pugh wrote:
DU <dr*******@hotWIPETHISmail.com> wrote:

The stupid thing about margins is that NS 4 does support CSS margins
applied to the body;

No it doesn't.
Well, I tried setting margins many years ago on NS 4.72 on the body node
and it worked.

Zero or non-zero margins?


Non-zero; margin: 4% IIRC.
Try it and see. The only CSS way of placing content
right up against the window edge in NN4 is absolute positioning.

That could be another issue...not sure what you mean by placing content.

<body><div>content

I want the content div to be right up in the top left corner with no
space between it and the window frame.


Yeah.. that would be a problem since there is a gap created by
block-level elements and line-height too. You can't have text perfectly
right up in the top left corner with no space between it and the window
frame unless you use abs. positioning and there, NN 4 is known to be
weak and buggy.
I was referring to rendering of margin for the body node. This reference
supports my claim:

http://devedge.netscape.com/library/...otes.html#5505

Not really, it's very vaguely worded. The only part that would apply
in this case is "Navigator does fairly well".
NN4 is okay so long as you want to increase the default margins of any
element, but as soon as you want to reduce them you often run into
problems.


That's possible; I did not test extensively, exhaustively its support
for margins.
body {margin: 0; padding: 0;} simply has no effect at all in NN4. Try
it and see.

Steve


Argh... I am sure I did not try margin: 0 because at the time, we were
trying to create cross-browser code with MSIE 5.5 and MSIE 6.
Removing margin on the body (and padding for Opera 7.x) just makes
reading a webpage harder.

DU
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2696
by: Terry | last post by:
I'm real new at this, so this may be a basic question, but I want to get off on the right foot. I thought it would be reasonable to use the following on a page: body { margin: 3em;...
1
2523
by: J. Potts | last post by:
Just out of curiosity, has anyone run into this problem? Someone where I work put a set of pages together with the following in the style sheet: BODY { position: absolute; margin-top: 0mm;...
6
47742
by: Joakim Braun | last post by:
How do you give a <body> a 10px margin on every side, then a border? That is, an inset border. In the example below, the browsers I've tried interpret "width:100%" as 100% of the width including...
6
3746
by: bigoxygen | last post by:
Hello. I would like to have a title bar (that has a logo) that is flush with the top of the browser display window. My code right now looks like this... <body id="evalResults"> <div...
12
2029
by: Terry Moon | last post by:
Hi I was using <BODY leftmargin=20 > which worked ok. but then I changed it to <BODY style="margin-left:20px;" and this works fine as well. In order to try and formalise things I decided to...
7
20663
by: Mark | last post by:
Hi, I am creating application in VB 2005. and when I print report it adds extra 0.45 cm margin on left and top, and the reason for this is physical margins of printer. Is it possible to change...
6
2263
by: Paul Wake | last post by:
Do paragraph bottom margins overrule body margins? (To explain what I mean, http://www.xmission.com/~wake/computerrules.html has 5% margins, including the bottom margin, in IE, but not in Firefox....
19
3960
by: david.karr | last post by:
If in my CSS I set the "background-color" property on the "body" element, it only covers the background of the elements defined in the body, up to the current width and height of the page. However,...
4
2470
by: AAaron123 | last post by:
<body runat="server" id="MainBody"> <form id="form1" runat="server" style="background-color:green; width: 100%; height: 100%"> <br /> Table1" runat="server" Style="background-color:Yellow;...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7165
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7205
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4910
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.