Results 1 to 4 of 4

Thread: XHTML complient coding

  1. #1
    Join Date
    Jun 2006
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default XHTML complient coding

    I am looking to make this bit of code XHTML compiant. The problem is that it is seeing the --> as the closing comment to the intial <!-- any thoughts on how this can be solved?
    Code:
    <!--[if lt IE 7]>    <!-- adsfasdf -->  <![endif]-->
    I was thinking this might work...
    Code:
    <![CDATA[
    <!--[if lt IE 7]>    <!-- adsfasdf -->  <![endif]-->
    ]]>
    but i could not.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Hm, tricky one. You could just use the <comment></comment> tag, which is now unsupported in just about every browser except IE.

    However, a more pressing question is: why? IE can't read XHTML anyway, so why are you bothering with the conditional comments?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jun 2006
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Screen readers have a hard time reading code if it is not compliant. The current project this is for runs everything through XML.spy and if there are any concerns then a red flag is posted. I'll try what you suggested, if any other thoughts feel free to share.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Rather than XHTML and XML.spy, I would suggest HTML (4.01 Strict) and the validator. Since you're also serving this to IE, it appears apparent that you're serving it as text/html. Thus, it's not actually being (or shouldn't actually be) parsed as XHTML by any user agent, browser or screenreader; you're effectively serving up invalid HTML, not XHTML at all.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •