Re: Validation Help

by "Bert" <bert(at)betterwebdesign.com.au>

 Date:  Fri, 19 Jul 2002 11:02:19 +0800
 To:  "Anthony Romano" <datachem(at)shadow.net>,
<hwg-basics(at)hwg.org>
 References:  mac default
  todo: View Thread, Original
G'day

> When trying to validate I am told there are no such attributes as
topmargin,
> etc. and will not validate the page.

These are browser specific tags that are not part of the spec, so they are
indeed invalid.

> Is there a way that I can validate the page and still  use these
attributes or
> substitute that will validate.

There is no substitute TAG for these that is valid.  However, you can use
CSS to get the same effect in MSIE 5/6 and Netscape 6.  Won't work in
Netscape 4 and I'm not sure about MSIE4.  You will have to decide which is
more important - have the site look the way you intended in Netscape 4
(though relatively few people still use it) or write valid code and accept
that some old browsers will not display the page quite as intended .  Here's
one version that should validate in HTML4.01 Transitional:

<body style="margin:0;padding:0;" bgcolor="#ffffff" link="#008c82"
vlink="#008c82" text="#000000" alink="#000000">

One other option that may even work in Netscape 4 is to position the BODY
tag (again with CSS) to coordinates 0,0.  Be careful as it can cause other
problems::

<body style="position:absolute;top:0;left:0;" bgcolor="#ffffff"
link="#008c82" vlink="#008c82" text="#000000" alink="#000000">

Experiment with the above and see what works best for you.

Regards
--
Bert Doorn, Web Developer
CIW Associate, IWA Member
www.betterwebdesign.com.au
Fast Loading, User Friendly Websites

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA