How to figure out CSS, W3c and html errors

by 10 replies
12
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.
#programming #css #errors #figure #html #w3c
  • 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
  • thank you so much does this error list also include html and css errors?
    • [1] reply
    • 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
  • 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?
    • [1] reply
    • 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).
      • [ 1 ] Thanks
      • [1] reply
  • 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.
    • [1] reply
    • 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.
      • [1] reply

Next Topics on Trending Feed