Results 1 to 12 of 12

Thread: [HTML] LEFTMARGIN, TOPMARGIN, etc... [Resolved]

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    [HTML] LEFTMARGIN, TOPMARGIN, etc... [Resolved]

    Attempting to validate this page:

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

    I get this:

    W3C validation results

    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.
    Last edited by mendhak; Dec 1st, 2004 at 11:50 PM.

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Those things should be specified in a stylesheet:

    Code:
    body{
          margin: npx;
    }
    This shorthand for top-margin left-margin etc goes clockwise, so it is:
    Code:
    margin: top right bottom left
    or if all sides are equal
    Code:
    margin: all
    the background:
    Code:
    body{
         background: color url(image);
    }
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    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?

  4. #4

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Ah... I see. I'm fixing it now. Will check back later.

  5. #5

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Problem solved, thanks a lot.

  6. #6
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Gotta love your christmas avatar lol!
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  7. #7
    New Member
    Join Date
    Nov 2004
    Posts
    9
    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.
    Webmaster of RockmanTV.

  8. #8

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    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?

  9. #9
    New Member
    Join Date
    Nov 2004
    Posts
    9
    I didn't think it did, but I just tried it and it seems to work ok..

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

  10. #10
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  11. #11
    New Member
    Join Date
    Nov 2004
    Posts
    9
    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 .
    Webmaster of RockmanTV.

  12. #12

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    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 .
    Exactly... http://sandpaper.mendhak.com/index.php works fine now.


    Thanks to everyone who posted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width