HTML 4.01 and margins..
Hi,
I thought I try to validate my new site using the W3 validator and it keeps telling me that there is no attribute "LEFTMARGIN" for this element. It gives me the same for "topmargin", "marginwidth" and "marginheight". Does HTML 4.01 not support these in the body tag? It seems to work just fine in the browsers. Maybe I need to set these using CSS?
PS. The only reason I'm validating the code is because it's going to be a webmaster site and I guess it would look bad if it failed to validate
Busy posted this at 19:49 — 17th September 2002.
He has: 6,151 posts
Joined: May 2001
the margins, left, right, top bottom ... have never been apart of the standards (wont valiadate)
CSS is your friend .
Then shouldn't you be using XHTML
The Webmistress posted this at 19:54 — 17th September 2002.
She has: 5,586 posts
Joined: Feb 2001
But if you only use CSS for it NS4. doesn't recognise it
Busy posted this at 20:13 — 17th September 2002.
He has: 6,151 posts
Joined: May 2001
NS4.7 does not sure about anything under thou
The Webmistress posted this at 20:15 — 17th September 2002.
She has: 5,586 posts
Joined: Feb 2001
So exactly how do you set it with css then?
zollet posted this at 20:35 — 17th September 2002.
He has: 1,016 posts
Joined: May 2002
You are very right. The reason I didn't however is because when I created a new XHTML document in DreamWeaver, it added the line <?xml version="1.0" encoding="iso-8859-1"?> which gives errors becasue the file is actually a PHP file.
Busy posted this at 20:35 — 17th September 2002.
He has: 6,151 posts
Joined: May 2001
I found it just the other day but then decided not to use it now I can't find what I used. Took me ages before to find it but something works
**DOH, gotta find it**
[edit]Had a quick look before dinner, can't find it, So assume I was wrong until I can prove otherwise, sorry[/edit]
dk01 posted this at 01:00 — 18th September 2002.
He has: 516 posts
Joined: Mar 2002
I dunno if you are still looking for this but here is what I beleive you are looking for.
body {
padding: 0px;
margin:0px;
}
You might actually only need one of the ones above. Can't remember at the moment so i put both.
-dk
zollet posted this at 01:03 — 18th September 2002.
He has: 1,016 posts
Joined: May 2002
The CSS margin's doesn't work in Opera 6.04 either and I if I put the margins int the body tag, then I can't put the W3C logo on the website. What to do?
Megan posted this at 01:47 — 18th September 2002.
She has: 11,421 posts
Joined: Jun 1999
The padding peroperty dk01 listed is needed for Opera, so if you put both in the code should work in all modern browsers.
Edit: And I wouldn't worry about having default margins showing in older versions of NS 4.
Megan
Connect with us on Facebook!
zollet posted this at 02:03 — 18th September 2002.
He has: 1,016 posts
Joined: May 2002
Thank you very much, the padding did wonders
PS. I'm not worried about NS 4.x users. The way I see it, if the website doesn't work for them, they have only themselves to blame for using such poor excuse for a browser. Why should I be the one spending hours and dealing with all the headaches that piece of **** causes. Get a better browser!
Suzanne posted this at 05:42 — 18th September 2002.
She has: 5,507 posts
Joined: Feb 2000
Couple of tidying up comments:
1. Don't use unit measures with zero values in the CSS -- padding: 0; is fine.
2. <? xml...> is optional. You can remove it without causing any problems whatsoever. It's NOT recommended for php pages because, well, the page won't work.
hth,
S
zollet posted this at 05:44 — 18th September 2002.
He has: 1,016 posts
Joined: May 2002
Well, I found a way around it (actually DW did it itself).
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Suzanne posted this at 05:57 — 18th September 2002.
She has: 5,507 posts
Joined: Feb 2000
ah, interesting solution. thanks!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.