valid html question

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

valid html question

Post by hob_goblin »

how do i set the margins on a page and it still be valid?

whenever i use topmargin, leftmargin, marginheight -- the w3 validator says they arent valid attributes

(otherwise i'd have a totally valid layout)
User avatar
fatal
Forum Contributor
Posts: 118
Joined: Sat Apr 20, 2002 10:47 am
Location: East Coast

Post by fatal »

There might be a new way of doing that now.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

try
style="border:1px 2px 3px 4px"
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

lol, using css defeats the purpose i would think, since IE is the only browser with good css support :-/
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

bzzz, wrong!

NN/Mozilla is the only browser with proper CSS support. and besides pretty much all browsers support the border style. you should consider using CSS more often anyway cause XHTML is making attributes more and more obsolete.
Last edited by mydimension on Mon Jun 03, 2002 8:27 am, edited 1 time in total.
MattF
Forum Contributor
Posts: 225
Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK

Post by MattF »

Opera also supports CSS very well.
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

if any of you would like checking out http://www.ice-on-fire.net/~team - in opera or netscape and telling me how it looks, and if you view the source the css is all there... if it looks bad, do you know what i'm doing wrong?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

If you're trying to set the margin's for a page try adding in a CSS declaration of:

Code: Select all

BODY { margin: 0; }
that'll remove the border from around the page.
If you want to set the margin's to be different, top, bottom, left and right try:

Code: Select all

BODY { margin: 10px 5px 15px 7px; }
The sizes are obviously not what you'd probably want but they go in the order - top -> right -> bottom -> left (like a clock 12 - 3 - 6 - 9).

This works in IE 5.x and up and Netscape 6.x, IIRC Netscape 4.7 just ignores it. Should be fine in Opera too.

Mac
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

Post Reply