Click to See Complete Forum and Search --> : XHTML? Modular?
rpanning
11-08-2004, 12:46 PM
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!
Charles
11-08-2004, 01:10 PM
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.
rpanning
11-08-2004, 04:39 PM
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
<!-- 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
<!-- 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>
MstrBob
11-08-2004, 04:50 PM
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>© Copyright 2004 Mr John Doe</p>
</div>
</body>
</html>
[code]
rpanning
11-08-2004, 05:00 PM
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!
Robert Wellock
11-10-2004, 07:14 AM
Do not use tables for positional layout.
rpanning
11-10-2004, 08:50 AM
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.
BuezaWebDev
11-12-2004, 02:21 AM
Hrmm, Just remember to think in terms of efficiency as well. Less lines of code /can/ be better. :P
Ben Rogers
11-18-2004, 07:01 PM
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.
David Harrison
11-18-2004, 08:20 PM
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.
MstrBob
11-18-2004, 08:25 PM
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.
Charles
11-18-2004, 08:35 PM
I take it you're not using the XML declaration, which is to say that a subset of XHTML™ 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™ 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...
David Harrison
11-18-2004, 08:43 PM
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™ 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™ 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.
Charles
11-18-2004, 09:54 PM
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.
Paul Jr
11-18-2004, 10:35 PM
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?
Charles
11-18-2004, 10:56 PM
Originally posted by Paul Jr
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? I'm saying that a valid XHTML document doesn't necessarily follow those simple guidelines and from what I've seen very few XHTML web authors do so either. The whole point of validity is that one can run ones document through a validator and if it passes then everything is fine. But that's not the case with XHTML. And for what? On the web it has no advantage and quite a disadvantage.
Paul Jr
11-18-2004, 11:03 PM
Originally posted by Charles
I'm saying that a valid XHTML document doesn't necessarily follow those simple guidelines and from what I've seen very few XHTML web authors do so either.
So if an XHTML document did follow those simple guidelines, it would be okay?
Charles
11-19-2004, 05:38 AM
Originally posted by Paul Jr
So if an XHTML document did follow those simple guidelines, it would be okay? Yes, but it's not just XHTML then, it's an XHTML / HTML hybrid.
Or put another way, XHTML on the whole is bad but a subset of XHTML isn't.
Or put yet another way, if you start with valid XHTML and then follow a whole another set of guidelines then you have only brought yourself up to the level of HTML. Why not just start with valid HTML 4.01 Strict?
Paul Jr
11-19-2004, 06:11 PM
All right, thanks. Just wanted to make sure I understood ev'rything. :)