PDA

Click to See Complete Forum and Search --> : [HTML] LEFTMARGIN, TOPMARGIN, etc... [Resolved]


mendhak
Nov 28th, 2004, 09:42 AM
Attempting to validate this page:

http://sandpaper.mendhak.com/index2.html

I get this:

W3C validation results (http://validator.w3.org/check?uri=http%3A%2F%2Fsandpaper.mendhak.com%2Findex2.html&charset=%28detect+automatically%29&doctype=%28detect+automatically%29)

there is no attribute "LEFTMARGIN"
there is no attribute "TOPMARGIN"
there is no attribute "MARGINWIDTH"
there is no attribute "MARGINHEIGHT"
there is no attribute "BACKGROUND" (for a <td>)
there is no attribute "BACKGROUND" (for a <table>)

What should I be doing for the leftmargin, topmargin thing?

Also, why is there a problem with just those two tags, I've used the background attribute in several other places on the page. Have a looksie for yourself.

Jop
Nov 28th, 2004, 10:45 AM
Those things should be specified in a stylesheet:


body{
margin: npx;
}


This shorthand for top-margin left-margin etc goes clockwise, so it is:

margin: top right bottom left

or if all sides are equal

margin: all


the background:

body{
background: color url(image);
}

mendhak
Nov 28th, 2004, 06:45 PM
Alright, the margin problem is corrected now.

But I don't understand why the validator would point out an error in just that particular <td> and <table> tag, I'm using backgrounds in other <td>s as well.

Any ideas?

mendhak
Nov 28th, 2004, 06:52 PM
Ah... I see. I'm fixing it now. Will check back later. :)

mendhak
Nov 28th, 2004, 07:14 PM
Problem solved, thanks a lot.

Jop
Nov 29th, 2004, 07:04 AM
Gotta love your christmas avatar lol!

FPG
Nov 29th, 2004, 10:32 PM
Just as a note, browsers like Firefox/Opera will not recognize the top and bottom margins for the body. However, IE does and since it supports 90% of the browser world, and it still looks ok in Firefox/Opera I wouldn't worry about it.

mendhak
Nov 30th, 2004, 06:05 AM
Originally posted by FPG
Just as a note, browsers like Firefox/Opera will not recognize the top and bottom margins for the body. However, IE does and since it supports 90% of the browser world, and it still looks ok in Firefox/Opera I wouldn't worry about it.

Sorry, your second sentence lost me there... Firefox would or would not allow for topmargin?

FPG
Nov 30th, 2004, 10:03 PM
I didn't think it did, but I just tried it and it seems to work ok.. :rolleyes:

In opera it doesn't, I've tried it in there, but I could of swore that Firefox didn't either...

CornedBee
Dec 1st, 2004, 03:41 AM
Opera and Firefox have far better support for anything CSS than IE.

That issue with Opera is that it doesn't have margins on the body by default, so removing them has no effect. Instead, Opera has padding.

body {
margin: 0;
padding: 0;
}

This is the complete cross-browser reset declaration.

FPG
Dec 1st, 2004, 02:13 PM
I agree, IE is constantly the thorn in my side when it comes to layout design. I've added several hours in layout design just because IE won't show things properly.

Referring back to my original post, I think I'm wrong about what I said about Firefox not supporting the margins. They work fine on my site when looking at it in firefox, so I don't know what I was thinking :bigyello: .

mendhak
Dec 1st, 2004, 10:50 PM
Originally posted by FPG
I agree, IE is constantly the thorn in my side when it comes to layout design. I've added several hours in layout design just because IE won't show things properly.

Referring back to my original post, I think I'm wrong about what I said about Firefox not supporting the margins. They work fine on my site when looking at it in firefox, so I don't know what I was thinking :bigyello: .

Exactly... http://sandpaper.mendhak.com/index.php works fine now.


Thanks to everyone who posted. :afrog: