How can I edit a webpage for W3C?

Discussion in 'HTML & Website Design' started by porwan, Jan 14, 2008.

  1. #1
    Line 222, Column 35: there is no attribute "LEFTMARGIN"

    <body bgcolor="#FFFFFF" leftmargin="0" topmargin= "0" marginwidth="0" marginheight="0">


    How can I edit a webpage for W3C?
     
    porwan, Jan 14, 2008 IP
  2. unitedlocalbands

    unitedlocalbands Well-Known Member

    Messages:
    246
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    #2
    Start with this, Always use either a CSS Style sheet or an inline style

    
    <body style="background-color:#FFFFFF; margin:0px 0px 0px 0px;">
    
    Code (markup):
    heres a link to a great W3C validator

    http://validator.w3.org/
     
    unitedlocalbands, Jan 14, 2008 IP
  3. HiredAtHome

    HiredAtHome Peon

    Messages:
    188
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Perhaps even cleaner code.

    Keeping the style inline:
    <body style="background: #fff; margin: 0;">
    Code (markup):
    If you separate it into a separate style sheet:
    body { background: #fff; margin: 0; }
    
    <body>
    Code (markup):
    H@H
     
    HiredAtHome, Jan 14, 2008 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    In other words, you should learn some CSS. In the Wayback times, leftmargin=0 was valid (I think). It hasn't been valid for a long time though.

    It's not easy going through a large, existing site and making itcompliant-- often you have to rewrite either the whole page or damn near.

    I strongly recomend this book: Build Your Own Web Site The Right Way Using HTML and CSS by Ian Lloyd. It re-starts you on the basics of (X)HTML and how to properly use some (really basic) CSS with it-- the right way. Once you know the basics of CSS you can either learn the rest in other books, or almost anywhere online (positioniseverything.com, htmldog.com, alistapart.com, Eric Meyer's pages including Mezzoblue.com... or HTML Utopia: Designing Without Tables Using CSS by Rachel Andrew and Dan Shafer. It really gets into how to actually set up pages using CSS, various positioning methods, FLOATS (which can be a bitch), and clearing.
     
    Stomme poes, Jan 14, 2008 IP
  5. Valve-Hosting

    Valve-Hosting Peon

    Messages:
    1,071
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Using inline CSS is defeating the main point though. Which is to seperate content and layout.
     
    Valve-Hosting, Jan 15, 2008 IP
  6. seth6226

    seth6226 Peon

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    margin:0px;
     
    seth6226, Jan 15, 2008 IP
  7. porwan

    porwan Active Member

    Messages:
    410
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #7
    Thank you so much for all.
     
    porwan, Jan 15, 2008 IP
  8. porwan

    porwan Active Member

    Messages:
    410
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #8
    But I have Failed validation, 11 Errors.


    -Line 54, Column 30: there is no attribute "ONTENT".
    <META NAME="copyright" ONTENT="Kamolporn Jewelry Co., Ltd.">

    -Line 54, Column 59: required attribute "CONTENT" not specified.
    <META NAME="copyright" ONTENT="Kamolporn Jewelry Co., Ltd.">

    -Line 380, Column 94: required attribute "ALT" not specified.
    … height="45" usemap="#Map" border="0"><map name="Map"><area shape="rect" coor

    -Line 468, Column 37: there is no attribute "BACKGROUND".
    <td rowspan="4" background="image/catagoriesbg.gif" valign="top">

    -Line 480, Column 102: required attribute "ALT" not specified.
    …pg" width="25" height="17" border="0"></a>

    -Line 482, Column 102: required attribute "ALT" not specified.
    …pg" width="25" height="17" border="0"></a>

    -Line 484, Column 101: required attribute "ALT" not specified.
    …pg" width="23" height="17" border="0"></a>

    -Line 590, Column 61: required attribute "ALT" not specified.
    … <img src="image/line.gif" width="194" height="25"><br>

    -Line 814, Column 61: required attribute "ALT" not specified.
    … <img src="image/line.gif" width="194" height="25"></td>

    -Line 950, Column 565: required attribute "ALT" not specified.
    …02,172" href="shop.php?catagory=ring"></map>

    -Line 1202, Column 79: there is no attribute "BACKGROUND".
    …pacing="0" cellpadding="0" background="image/bar.gif">



    PS. link from validator.w3.org is http://validator.w3.org/check?uri=h...(detect+automatically)&doctype=Inline&group=0


    Thank you all.
     
    porwan, Jan 15, 2008 IP
  9. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #9
    ONTENT was probably intended to be CONTENT, no? Misspelling : )

    ALT tag is required for all images. It must say either what the image says, is, or does. I do not recommend using image maps for anything other than real, throwing-bombs-from-a-plane maps.

    BACKGROUND is a shortcut. You can only use it when combining multiple background properties, such as colour, image, image position, repeating, and fixed/scrolling. You should change BACKGROUND to background-image: url(blahblah.gif);

    Lowercase all your tags to get into good habits. It's still allowed, not for XHTML Strict and maybe not for HTML4 strict (I might be wrong, that might only be for xml/xhtml), so most of us try to use that habit.

    Good luck.
     
    Stomme poes, Jan 15, 2008 IP