How to figure out CSS, W3c and html errors

10 replies
I had a review done by fellow warriors recently and someone pointed out that my site had CSS, W3C (validator?) and html errors can some fellow programming savvy warriors please help me out so I can have them fixed. Thanks a bunch.
#css #errors #figure #html #w3c
  • Profile picture of the author Bruce Hearder
    Use http://validator.w3.org to find all your sites errors.

    If you don't know to fix them, then note down the errors and then get someon on RentaCoder or someplace like that that will do the job for you.

    Hope this helps

    Bruce
    {{ DiscussionBoard.errors[1765446].message }}
  • Profile picture of the author charto911
    thank you so much does this error list also include html and css errors?
    {{ DiscussionBoard.errors[1765484].message }}
    • Profile picture of the author Bruce Hearder
      It will list the HTML errors, and then is a seperate part of the site you can validate your CSS files as well.

      Hope this helps

      Bruce
      {{ DiscussionBoard.errors[1765512].message }}
  • Profile picture of the author charto911
    is it possible to clean up all the html and CSS errors? or is that unneccessary to do? Also what does it mean when I have no errors?
    {{ DiscussionBoard.errors[1857096].message }}
    • Profile picture of the author wayfarer
      Originally Posted by charto911 View Post

      or is that unneccessary to do?
      Well, it's not necessary if the site displays the same across all current web-browsers, however, having valid code may help you in the future if you have a compatibility issue and need to eliminate it as a possibility when debugging a layout.

      A lot of errors have no practical need to be fixed. For example, XHTML requires that self-closing tags be closed like this: />, while in plain HTML, it is closed like this: >. The reality is, browsers treat both exactly the same no matter which document format you're using. A validation will tell you that the code is wrong, but it doesn't matter in reality.

      If I'm having a problem in one browser and not another, often the first thing I'll do is run a validation. The reason is that validation checks for common errors, like not closing a tag, or closing a tag in the wrong place. Since I generate a lot of code dynamically, through a database loop or whatnot, it is relatively easy for me to make this mistake. Tag closing issues are one of the #1 reasons that browsers will display something differently, since there is no standardized way that a browser is supposed to deal with malformed code.

      Because of the tag closing issue, I'll often fix other errors along the way so that it is easier to read the validation if I suspect a problem. It is not uncommon for my pages to validate 100%, even very large or complex ones. However, I never impose a strict rule that pages MUST validate or else, because there isn't anything in reality that requires pages on the web to be valid.

      My CSS files rarely validate, because I put inline hacks to target certain browsers. Although I sometimes write conditional comments and keep browser specific rules in another file, for smaller projects it is much quicker to do everything in one file. Also, I use CSS 3 rules, and use Microsoft, Mozilla, or Webkit rules when needed, which don't pass the only validation that is current, CSS 2.1. CSS 3 is an incomplete specification and actually changes month to month, but it is still useful because a few of its features are now widely implemented, especially in Webkit (Safari and Chrome).
      Signature
      I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
      {{ DiscussionBoard.errors[1857374].message }}
      • Profile picture of the author naffets77
        If you check out google.com, amazon.com etc in validator tools, none of them validate. Validation is really only worried about by a fairly small set of developers that speak very loudly.

        I'm not saying that you shouldn't try to validate but sometimes it's far more work than is worth. For example it is really simple to make a div a link by wrapping it with an <a> tag, but that doesn't validate.. however it's super easy and if you're doing a simple 1 page site it really doesn't matter.

        As for SEO it's not so much whether your site validates, but rather if the search spiders can parse your site easily/well enough to get the content. I.e. if you have a ton of broken html tags and are doing weird stuff or not using <h1>,<h2> tags for headings and things like that then the spiders might not be able to index your information.

        CSS validation is even more ridiculous, just becuase you have to use hax to make the diff browsers look alright.

        Did the people who reviewed your site point out any errors in specific, or just put your site in a validator and said it didn't validate? IF the site looks good to you, and you have an understanding of basic SEO strategies then don't lose sleep on it.
        {{ DiscussionBoard.errors[1862295].message }}
        • Profile picture of the author charto911
          Wow great points thanks so much for an intelligent response I got the error ideas from a dp review and didn't know if I should fix them I know I don't have h2 tags maybe u can look briefly at the hp and let me know what ya think
          {{ DiscussionBoard.errors[1862402].message }}
  • Profile picture of the author naffets77
    Your site looks pretty good, I wouldn't worry so much about the h tags because anything you could change to h tags arn't so much what you'd be targeting SEO wise I don't think. Bottom line is if you have a site where you have a lot of subtitles then it's better to wrap in h tags then div's or span's etc.
    {{ DiscussionBoard.errors[1864451].message }}
    • Profile picture of the author jminkler
      I wouldn't worry about XHTML at all. Use HTML 4 Strict. There is no reason to use XHTML besides some odd standard. XHTML is based on XML, and currently there is no way to correctly serve it to IE. (Content-type application/xhtml).

      Your pages will render slightly faster if they properly validate. If they don't validate the browser has to go figure out "what's best" and could crunch up some time.
      {{ DiscussionBoard.errors[1867040].message }}
      • Profile picture of the author wayfarer
        Originally Posted by jminkler View Post

        There is no reason to use XHTML besides some odd standard. XHTML is based on XML, and currently there is no way to correctly serve it to IE. (Content-type application/xhtml).
        A highly misleading statement. IE has no problem with XHTML.

        Originally Posted by jminkler View Post

        Your pages will render slightly faster if they properly validate. If they don't validate the browser has to go figure out "what's best" and could crunch up some time.
        Not true, validation has nothing to do with how fast a page renders. There is nothing to substantiate this statement unless you take every possible step of logic of the rendering engine into account.
        Signature
        I build web things, server things. I help build the startup Veenome. | Remote Programming Jobs
        {{ DiscussionBoard.errors[1867765].message }}

Trending Topics