Results 1 to 13 of 13

Thread: @Those good with W3 HTML coding standards...

  1. #1

    Default @Those good with W3 HTML coding standards...

    Ok, this is driving me insane. I'm trying to validate my page and have reduced it to 3 errors. All 3 pertain to my DIV tags and my attempt to center 3 certain images.
    Now, if those are evidently invalid, illegal, deprecated, or whatever the hell the W3 calls them, what IS the standards compliant way to center something? If it matters, these items are inside a TD, but that shouldn't.

  2. #2
    Hypnotising you crono_logical's Avatar
    Join Date
    May 2001
    Location
    Back in Time
    Posts
    9,313
    Contributions
    • Former Administrator
    • Former Cid's Knight

    Default

    I'd guess using CSS
    Problems playing downloaded videos? Try CCCP


  3. #3

    Default

    Thanks for the ummm... help? That's just a little vague...

    EDIT: Gah, and I can't even post the error message they give me because the html screws up this topic page.
    Last edited by Chzn8r; 10-05-2004 at 02:03 AM.

  4. #4
    ORANGE Dr Unne's Avatar
    Join Date
    Dec 1999
    Posts
    7,394
    Articles
    1
    Contributions
    • Former Administrator
    • Former Developer
    • Former Tech Admin

    Default

    Post the HTML.

  5. #5

    Default

    http://validator.w3.org/check?uri=ht...ically%29&ss=1

    That's the page with the validation results, the source is listed below it.

  6. #6
    ORANGE Dr Unne's Avatar
    Join Date
    Dec 1999
    Posts
    7,394
    Articles
    1
    Contributions
    • Former Administrator
    • Former Developer
    • Former Tech Admin

    Default

    For one thing, all tags must be closed. That includes img and br tags. Use

    <img src="blah.png />

    and

    <br />

  7. #7

    Default

    Bah, I thought that was only in strict things (XHTML for example). If that's really the case I've got a lot of work to do...

    EDIT: http://validator.w3.org/check?uri=ht...ically%29&ss=1

    Ok that didn't take as long as I thought... every BR tag ends in " /" now and every IMG tag as well.

    Problem still isn't solved but I suppose this is a step towards the right direction anyways.
    Last edited by Chzn8r; 10-05-2004 at 03:02 AM.

  8. #8

    Default

    Try changing

    div style="text-align: center;"

    To this

    div align="center"

  9. #9
    ORANGE Dr Unne's Avatar
    Join Date
    Dec 1999
    Posts
    7,394
    Articles
    1
    Contributions
    • Former Administrator
    • Former Developer
    • Former Tech Admin

    Default

    Tags can't be capital letters. Change TITLE to title for example.

    Anyways, that error tells you exactly what's wrong.

    Code:
    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
    
    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
    Looking at your code, you have a &lt;b> on line 40 and it's closed on line 135. You can't have a div inside a b. b is inline and div is block. You're trying to boldify a div, which is undefined behavior. Remove the b and the closing b and it validates. You should put the b tags around all the individual bits of text you want boldified.

    It only validates as HTML though. You should really try to get it to validate as XHTML. Actually I was wrong, I don't think you even need to close all your tags in HTML, like I said above, or make all your tags lowercase either; I was assuming you were going for XHTML. XHTML is the GOOD standard. It's not hard to get it to that level either. Replace your b's with strong's and your i's with em's, and stuff like that.

  10. #10
    Away Founder Cid's Avatar
    Join Date
    Dec 1999
    Location
    In your tree.
    Posts
    2,049
    Articles
    141
    Contributions
    • Created Eyes on Final Fantasy
    • Former Administrator

    Default

    Why bother having all these rules, like no capitals, it it still works in both browsers fine? What difference does it make?

  11. #11
    ORANGE Dr Unne's Avatar
    Join Date
    Dec 1999
    Posts
    7,394
    Articles
    1
    Contributions
    • Former Administrator
    • Former Developer
    • Former Tech Admin

    Default

    The purpose of standards is to make sure that when I make a web page over here, no matter where you are, it'll look the same. That's why there are so many rules; honestly, the more rules the better, so long as the rules don't take away from the power of the language. The rules probably make it easier to standardize web browsers. Defining XHTML strictly doesn't leave room for IE to do one thing and Mozilla to do another, in terms of rendering pages.

    Some rules are less important than others though. XHTML is HTML that is also XML, so that's WHERE the rules come from. XML happens to say that tags should be all lowercase, and the values should be quoted, for example. As for WHY the rules exist, that's debateable I guess. The quote rule is a good and necessary rule; what if your value has a space in it? Quotes are necessary in that case. The lowercase thing honestly could've gone either way in my opinion. They could've made it all uppercase, or a combination of either. But they did have to pick SOMETHING as the standard.

    Programming languages in general tend to have all lowercase keywords, maybe that's why they picked it. Beats me. All lowercase tags also sets them apart from the text and makes it easier to read. And if you allowed a mix, you are required to define more rules: should an HTML tag be the same as an html tag? What about Html, or HtMl? If I open an HTML tag, can I close it with an html tag, or do I need to close it with HTML too? XML is geared towards being exact. The whole purpose of XML is data-exchange, and with data that's more complex than HTML (and a lot of data IS far more complex), the little details can matter.

  12. #12

    Default

    Thank you Unne, you are a GOD, and yes I've been reading up on it and plan to eventually achieve XHTML Strict, but I've gotta step up slowly from HTML Transitional right now.

    Thank you once again.

  13. #13

    Default

    Well my main page w/ the default "News" and "Menu" includes is verified XHTML, now comes the hard part... doing the entire content of the site This'll be slow-chugging I can guaruntee.

Posting Permissions

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