SitePoint Sponsor

User Tag List

Results 1 to 23 of 23
  1. #1
    SitePoint Guru htown's Avatar
    Join Date
    Mar 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wacky HTML validation

    I have looked at the code and I am not sure why I am getting 20 validation errors on this page. i am having some SEO done to this page and he is telling me i have two occurances of the body tag. i am not seeing that. If you do a validation on the page i get about 20 errors and I am not really seeing any of them. It is telling me that tags are not being closed when they are and such.

    Would appreciate some guidance here. What am I missing here?

    thanks,
    houston
    Houston Brown
    Split Light Designs
    Bringing your ideas to light.

  2. #2
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    HTML Tidy gives 5 warnings.

    You've got two BODY ONLOAD tags.

    You have two open IMG tags -- in XHTML, the IMG tag must be closed. http://www.w3schools.com/tags/tag_IMG.asp
    You're using HTML Transitional, so I'm not sure why this is showing up as an error.

    You have a & character which should be a & character.

    You're using a TITLE tag in a UL.

    Add this to Firefox, you'll like it:
    http://users.skynet.be/mgueury/mozilla/

  3. #3
    SitePoint Guru htown's Avatar
    Join Date
    Mar 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The reason I am not seeing the double <body> tag is that I have an include and I was not looking at the generated html. Now i see the problem. But I am still not seeing the problem that is causing the "Opening and ending tag mismatch" and missing IMG end tag.

    I am using Dreamweaver and all of the code is collered correctly meaning that all the code is correct. obviously I am missing something but I can not find it. Perhaps I will see it in the morning.

    Thanks for the link too. nice tool.

    Houston
    Houston Brown
    Split Light Designs
    Bringing your ideas to light.

  4. #4
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,692
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    I am using Dreamweaver and all of the code is collered correctly meaning that all the code is correct.
    Dreamweaver doesn't know anything about code - you'll have to run it through a validator to know whether the code is valid.

    Since you're declaring your code as XHTML (which is a bad idea, since you're really using HTML), you have to add a slash to every stand-alone tag. Furthermore, all tag attributes must be lowercase in XHTML, meaning onMouseOver, onMouseOut and onLoad is not an allowed (you have to use onmouseover, onMouseOut and onload - or better, use CSS, since Javascript is a very resource-intensive image replacement method).
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  5. #5
    SitePoint Guru htown's Avatar
    Join Date
    Mar 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by C. Ankerstjerne View Post
    Since you're declaring your code as XHTML (which is a bad idea, since you're really using HTML),
    I am learning something here. I feel like I have always created pages using transitional but I think I made a mistake this time and choose XHTML. I have changed the doctype and now I only get three errors, none of which make any sense to me because I am once again not seeing what it seems to be finding wrong.

    I have never had this much trouble getting a page to validate correctly but I have a green light on that page now.

    Thanks for the assistance.
    Houston
    Houston Brown
    Split Light Designs
    Bringing your ideas to light.

  6. #6
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    I just looked at your site today, and it says passed validation. What were the errors?

    The MMswap thing is a nasty piece of code. If you're interested, take a look at image replacement techniques, css sliding doors, and css image sprites. You can have background images change with CSS alone, using just :hover/:focus instead of onmouseovers.

  7. #7
    SitePoint Guru htown's Avatar
    Join Date
    Mar 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the confusion. after working on some of the code for a while I fixed the page. That is why I said i got a green light on the page.

    So is there any advantage to using a doctype of "strict" over "transition"?

    Thanks,
    Houston
    Houston Brown
    Split Light Designs
    Bringing your ideas to light.

  8. #8
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    The short answer is No, however, there is almost no reason to use transitional doctypes. So, the long answer is Yes, in that it's like eating your spinache. It's good for you. Transitional lets some older, deprecated tags and attributes through which generally shouldn't be used. Strict forces you to quit using them. Strict can also help you write well-formed code, though I think I've seen some non-well-formed stuff pass the validator on occasion (not sure, long time ago).

  9. #9
    SitePoint Guru htown's Avatar
    Join Date
    Mar 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How difficult is it to convert transitional to strict? I always use css and never any deprecated code anyways.
    Houston Brown
    Split Light Designs
    Bringing your ideas to light.

  10. #10
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by htown View Post
    So is there any advantage to using a doctype of "strict" over "transition"?
    Yes, if you validate your markup. You will then be made aware if you accidentally use deprecated elements or attributes which go against the goal of separating content from presentation and behaviour.

    Quote Originally Posted by htown View Post
    How difficult is it to convert transitional to strict? I always use css and never any deprecated code anyways.
    In that case your markup will validate as Strict. The main difference between Strict and Transitional is that the latter contains a number of elements and attributes that are deprecated in the former.

    Another difference is that certain elements (like body and form) can only have block-level children in the Strict DTD, whereas the Transitional DTD inexplicably allow inline children and even plain text.
    Birnam wood is come to Dunsinane

  11. #11
    SitePoint Guru htown's Avatar
    Join Date
    Mar 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AutisticCuckoo View Post
    Another difference is that certain elements (like body and form) can only have block-level children in the Strict DTD, whereas the Transitional DTD inexplicably allow inline children and even plain text.
    What is DTD?
    Houston Brown
    Split Light Designs
    Bringing your ideas to light.

  12. #12
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DTD = Document Type Definition

    A long, gnarly mass of text the primary goal of which is to tell you precisely what you can do with the tags in your document, but the side effect of which is to leave many people scratching their heads in disbelief over the complexity of such a simple thing as (X)HTML.

    The various DTDs can be found at the w3.org site (look in your doctype).

  13. #13
    SitePoint Guru htown's Avatar
    Join Date
    Mar 2005
    Posts
    661
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So reading all the DTD's is about as exciting as a tax audit then is what you are telling me.

    Cheers
    Houston Brown
    Split Light Designs
    Bringing your ideas to light.

  14. #14
    SitePoint Enthusiast
    Join Date
    Jun 2008
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why do errors even matter if site looks good and works?
    Check out our newest FREE Internet
    Marketing Methods resource
    at http://www.TopInternetMarketingMethods.com

  15. #15
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,692
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    That depends. DTDs are very helpful, and reading can certainly give you some interesting ideas for better coding.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  16. #16
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by htown View Post
    What is DTD?
    You may want to read the HTML FAQ to learn some of the basics. If you're going to use XHTML markup you should then definitely read the XHTML vs HTML FAQ before you do anything else.

    Quote Originally Posted by navtej231 View Post
    Why do errors even matter if site looks good and works?
    How do you know it looks good and works if it's got errors? Just because it happens to work – by pure chance – in your browser on your computer doesn't mean it will work for everyone. Especially not for people who access the site through assistive technology, such as a screen reader.
    Birnam wood is come to Dunsinane

  17. #17
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The screen reader is always mentioned as an "example" of assistive technology, but are there actually any others that can be used with websites?

  18. #18
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,692
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Yes. Braille machines, for example.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  19. #19
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Screen magnifiers; tactile mice; suck/blow input devices; even trackballs could be seen as assistive technology for those who cannot use a regular mouse.

    Also, there are different types of screen readers. One type is used by blind or visually impaired users who cannot see the content. Another type is used by people with certain types of dyslexia, who can see perfectly well but have difficulties reading because of their disability. This type often overrides the colours, e.g., making the text blue on a light yellow background. It often also highlights words in the text while it's reading them out, making it easier for the user to follow along.
    Birnam wood is come to Dunsinane

  20. #20
    SitePoint Wizard bronze trophy Black Max's Avatar
    Join Date
    Apr 2007
    Posts
    4,029
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by navtej231 View Post
    Why do errors even matter if site looks good and works?
    You have just opened the gates to Hell.

  21. #21
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks chaps, I hadn't even heard of some of those.

  22. #22
    om nom nom nom Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,233
    Mentioned
    47 Post(s)
    Tagged
    1 Thread(s)
    Suck/blow input devices? Never heard of them either, though I assume those are for paraplegics... though I thought there was an eyeball-blink-selector out there...

    Okay, I got the 40min JAWS demo and MAGic demo free, but I don't think I'll get my hands on any of the others soon, so I'm pretty much testing to GoogleView (no CSS or images, is there still a usable readable page?) for basic sturdiness.

    And I suck at using JAWS, my god.

  23. #23
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nothing to do with websites, but I remember someone being in the news for sailing across the channel just using a suck/blow mechanism!

    On a more relevant note, I went to an IT conference a while ago. Most of it was boring but nearing the end of the conference a blind guy got up on stage and started a presentation on assistive technologies. It really opened my eyes to the importance of accommodating such technologies in websites and other IT systems.
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)


Bookmarks

Posting Permissions

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