Get your CSS/XHTML to validate

Discussion in 'CSS' started by geoiss2004, Apr 4, 2008.

  1. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    There are some errors on that page.

    1) Self closing tags in HTML do not end in />. Only XHTML does.
    2) Validation means you are using the correct syntax only and does not guarantee accessibility, usability or anything else.
    3) Search engines do not give preference to validated pages though it may prevent them from getting tripped up by markup that doesn't make sense.
    4) It mentions "overlapping elements" as a <div> contained in a <p> but not only shouldn't you do that, it's invalid anyway. If you validate, that will point out that error for you.
    5) Validation is not hard if you validate early and often. Some people wait till their done to do that but by then they've dug a deep hole.

    In any case, I'll be first in line to point out when somebody's page doesn't validate.
     
    drhowarddrfine, Apr 4, 2008 IP
  2. dzdrazil

    dzdrazil Peon

    Messages:
    64
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    a quick note: the css on that page has at least 6 errors, all of which i saw were instances of padding and margin written as .padding and .margin... ironic?
     
    dzdrazil, Apr 4, 2008 IP
  3. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #4
    Very Wrong.

    Wrong.

    It's an OK article, but doesn't really get into the subtelties of semantics.

    Don't know what this post was for, I just like saying "wrong"
     
    blueparukia, Apr 4, 2008 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Damn, you guys are saving me the trouble of bashing it.
    <anti-dad> Now that your spirit is crushed, my job here is done</anti-dad>
     
    deathshadow, Apr 4, 2008 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Not to mention me, either. It's been a while since I've ripped bad advice to shreds and replaced it with facts.
     
    Dan Schulz, Apr 4, 2008 IP
  6. geoiss2004

    geoiss2004 Guest

    Messages:
    1,454
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    0
    #7
    how is it bad advice? usability and accessibilty are very important and if people with less knowledge are reading it, they might be swayed into thinking they need to push themselves more in this area.
     
    geoiss2004, Apr 6, 2008 IP
  7. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #8
    Nobody said it was bad advice. Every one who posted in this thread always make sure their HTML and CSS are valid (and Deathshadow and Dan make their's so damn semantic and accessible).

    Only valid code has nothing to do with usabilty and little to do with accessibility.

    Remember, valid code does not mean good code. Valid code (in my opinion, and I think most people here will agree) means nothing if no semantic methods (for want of a better word) have been applied.

    There is little point validating if your code looks like:

    
    <div id="heading" class="heading1" style="border:none">
     <div>
       <span style="font-size:142em" id="header_text">Heading</span>
     </div>
    </div>
    
    Code (markup):
    That validates strict, sure - but is the definition of crap code.
     
    blueparukia, Apr 6, 2008 IP
  8. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #9
    Another way to look at it is I can write the sentence "Car dog run hair" and a spell checker will "validate" it but, of course, the sentence makes no sense, contains no good information and is hardly usable. The same is true with validation.
     
    drhowarddrfine, Apr 6, 2008 IP
  9. Divisive Cottonwood

    Divisive Cottonwood Peon

    Messages:
    1,674
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Divisive Cottonwood, Apr 6, 2008 IP
  10. Divisive Cottonwood

    Divisive Cottonwood Peon

    Messages:
    1,674
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #11
    It doesn't guarantee accessibility in itself, but valid markup is essential for passing W3C Priority 2 rules so can't be brushed aside.
     
    Divisive Cottonwood, Apr 6, 2008 IP
  11. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #12
    Nowhere do I say validation should be brushed aside. In fact, I will be the first to jump on anyone's case for not validating their page.
     
    drhowarddrfine, Apr 6, 2008 IP
  12. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Jump like a rabid squirrel who's gotten into the vat where they make Red Bull. : )

    By the way, now I have to know, what's a divisive cottonwood? Is it related to the uniting cottonwoods?
     
    Stomme poes, Apr 6, 2008 IP
  13. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I'll attest to that.
     
    Dan Schulz, Apr 6, 2008 IP
  14. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #15
    I saw you Dan. ;)

    But I'm outta here. Too many Microsoft people.
     
    drhowarddrfine, Apr 6, 2008 IP