www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: XHTML? Modular?

  1. #1
    Join Date
    Jul 2003
    Location
    MN, USA
    Posts
    75

    XHTML? Modular?

    Ok, I'm starting to make a new design to be section 508 and WAI compliant. It's just hard to decide what standard to use and how to code it. My questions are:

    Should I use XHTML or just HTML?
    From what I have found XHTML will be a little better for screen readers. But, I will need the TARGET anchor attrib so XHTML 1.0 Transitional appears to be the best option. Any thoughts on that?

    Should I make the design modular?
    For example, should I put the body first, then navigation, then copyright, etc. to help the screen readers? Then I'd use CSS to format the layout of the page. However, I've had a hard time getting things positioned right doing this. Have any good tutorials for doing this or should I just nest divs like a table to get the formatting?

    Thanks for your input!

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    A lot of people seem to have confused XHTML with the strict DTDs. XHTML 1.0 is simply an XML application of HTML 4.01. And like HTML 4.01 it comes in three flavours: strict, transitional and frameset. There is a great advantage to using the strict DTDs over the transitional ones but no advantage in using XHTML. And there are a number of problems associated with using XHTML on the web, so much so that the XHTML 1.0 specification contains an appendix listing them. Do not use XHTML unless you really know what you are doing. However, do use a strict DTD.

    Child windows cause some accessibility problems but you can count on most of the folks so affected to have them disabled. If you want to use the "target" attribute then validate your page as HTML 4.01 Strict - you can either temporarily change the DOCTYPE or employ the DOCTYPE override on the validator - ignorring the warnings about "target" attribute. And then you can publish your page with a transitional DOCTYPE but with all of the advantages of HTML 4.01 Strict.

    It is best keep the content as high up as possible, but in any case it is a good idea for the very first thing on a page to be a "skip to content" link. And you can use CSS to hide that link from all but who need it.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Jul 2003
    Location
    MN, USA
    Posts
    75
    So you think HTML 4.01 Transitional, validated as Strict, would be the best option? I've seen XHTML used everywere in WAI examples. Just seems like people think it reads better in screen readers.

    What did you think about the modular approach? I didn't quite get your opinion. Thanks

    Code:
    <!-- MODULAR -->
    <div id="Quick_Links">Hidden Jump Links</div>
    
    <div id="Content">Content</div>
    
    <div id="Site_Name">Website/Domain</div>
    
    <div id="Doc_Title">Document Title</div>
    
    <div id="Site_Nav">Site Navigation Links</div>
    
    <div id="Main_Nav">Global Navigation Links</div>
    
    <div id="Copyright">Copyright</div>
    VS
    Code:
    <!-- TABLE LIKE (NON-MODULAR) -->
    <div id="Quick_Links">Quick Jump Links</div>
    
    <div id="Header">
      <div id="Site_Name">Website/Domain</div>
      <div id="Main_Nav">Global Navigation Links</div>
    </div>
    
    <div id="Middle">
      <div id="Right">
        <div id="Doc_Title">Document Title</div>
        <div id="Content">Body</div>
      </div>
      <div id="Left">
        <div id="Search">Search</div>
        <div id="Site_Nav">Site Navigation Links/div>
      </div>
    </div>
    
    <div id="Copyright">Copyright</div>

  4. #4
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    Well, that's not really modular, now is it? And you seem to be forgetting the golden rule of HTML, which is to use tags which best describe your data. Which is a better description? <div>Document Title</div> or <h1>Document Title</h1>. For your basic page, one would expect markup along the lines of this:

    [code]
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
    <html lang="en" dir="ltr">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <meta name="Content-Style-Type" content="text/css">
    <title>Page Title</title>
    <style type="text/css">
    <!--
    -->
    </style>
    </head>
    <body>
    <div id="content">
    <h1>Page Title</h1>
    <p>Text, text, and more text</p>
    <h2>Sub Title</h2>
    <p>Text, text, and more text</p>
    <h3>Sub-sub Title</h3>
    <p>Text, text, and more text</p>
    <h2>Sub Title</h2>
    </div>
    <div id="navigation">
    <ul>
    <li><a href="home.html" title="Homepage">Home</a></li>
    <li><a href="about.html" title="About Us">About Us</a></li>
    <li><a href="links.html" title="Interesting Links">Links</a></li>
    </ul>
    </div>
    <div id="footer">
    <p>&copy; Copyright 2004 Mr John Doe</p>
    </div>
    </body>
    </html>
    [code]

  5. #5
    Join Date
    Jul 2003
    Location
    MN, USA
    Posts
    75
    The only reason I broke it up into div's like that is because I'm going to make the layout with CSS. So I can position everything were I want it via CSS. Naturaly the titles will be inside a header but also inside the div because I will have other stuff inside the div. I'm just wandering which is the better method of layout, table-like or div/CSS positioning. Thanks!

  6. #6
    Join Date
    Nov 2002
    Location
    XYZZY - UK
    Posts
    1,760
    Do not use tables for positional layout.

  7. #7
    Join Date
    Jul 2003
    Location
    MN, USA
    Posts
    75
    Originally posted by Robert Wellock
    Do not use tables for positional layout.
    No, of corse not. I ment I'll use nested divs to get the layout kindof like nested tables.

  8. #8
    Join Date
    Jul 2004
    Location
    West Coast, Canada
    Posts
    665
    Hrmm, Just remember to think in terms of efficiency as well. Less lines of code /can/ be better. :P

  9. #9
    Join Date
    Jan 2004
    Posts
    2,422
    Charles, I'm interested in how exactly the use of XHTML 1.1 is negative. I test in IE 5, 5.5, and 6.0; none of them seem affected by the use of XHTML.

  10. #10
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Originally posted by rpanning
    The only reason I broke it up into div's like that is because I'm going to make the layout with CSS. So I can position everything were I want it via CSS.
    There's nothing stopping you from positioning an <h1> element with CSS. The <h1> element comes with browser default font-sizes, margins and padding but these can all be removed/altered with CSS.

    Most of the time I see navigational links marked up in an unordered list and then put in a <div> tag. There's no need for the <div> tag, people just don't seem to understand that what you can do to a <div> tag you can do to almost anything.
    Every fight is a food fight when you’re a cannibal.

  11. #11
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    One should really cut down the amount of <div> and <span> tags used to the bare minimum. First off, there is a series of tags which better describe the text that can be used. The <div> and <span> tags are simply to provide some additional structure to the page, and divide it up for styling or languages. With style sheets, you have the power to make an unordered list look like a table, if you so desired (though that would be pointless) <h1>Header</h1> With that line, you can add a background, change color, change font, change size, add border. Hell, you could place it underneath the text that comes after it, if you really wanted. When creating your HTML, it's simply best to forget about all your visuals, and mark up all your text in the way that makes the most sense for the text itself. Visuals are easily manipulated, and often, a semantically marked up page will flow a lot better.

  12. #12
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    I take it you're not using the XML declaration, which is to say that a subset of XHTML&trade; 1.1 documents works on that browser. Which is the whole point. There are lots of ways that you can make an XHTML document that doesn't work on some browser but if you avoid those problems everything is fine. The ways are even listed in the XHTML&trade; 1.0 specification but nobody ever bothers to read them or avoid them. And when one considers that there is no advantage on the web whatsoever in using XHTML over HTML...
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  13. #13
    Join Date
    Dec 2002
    Location
    Manchester, UK
    Posts
    6,276
    Originally posted by Ben R.
    Charles, I'm interested in how exactly the use of XHTML 1.1 is negative. I test in IE 5, 5.5, and 6.0; none of them seem affected by the use of XHTML.
    Originally posted by Charles
    I take it you're not using the XML declaration, which is to say that a subset of XHTML&trade; 1.1 documents works on that browser. Which is the whole point.
    Personally I use XHTML 1.1 and I use the xml prologue, my site still works fine from IE5+. Also works in IE4- but I hide the styles from those browsers.

    Originally posted by Charles
    There are lots of ways that you can make an XHTML document that doesn't work on some browser but if you avoid those problems everything is fine. The ways are even listed in the XHTML&trade; 1.0 specification but nobody ever bothers to read them or avoid them.
    That is not the fault of the specification, that is the fault of half-hearted web-designers.
    Every fight is a food fight when you’re a cannibal.

  14. #14
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    That's exactly like suggesting that the transitional DTD is better than the strict because you can follow the strict ules and still use the transitional DOCTYPE. And that some or all transitional documents don't measure up is the fault of the web authors and not of the specification.

    The whole purpose of DTD is that it means something when a document is valid.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  15. #15
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    Originally posted by Charles
    And when one considers that there is no advantage on the web whatsoever in using XHTML over HTML...
    Well the W3C doesn't seem to think so. According to them, and I quote, “XHTML documents can be written to operate as well or better than they did before in existing HTML 4-conforming user agents as well as in new, XHTML 1.0 conforming user agents.”.

    The W3C seems to think XHTML is very backwards compatible.

    They say browsers that support HTML 4 will have no problem with XHTML as long as a few simple guidelines are followed. Are you saying that even if the guidelines are followed, there are still disadvantages and no advantages of using XHTML over HTML for the purpose of creating web pages?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles