Forum Moderators: open
and now, for the life of me, i can't figure out what i ever saw in it. what is the big hoo-haa about xhtml?
the only benefit i can see to it now is that it encourages better coding.
but strict HTML allows you to cut your page weight massively. no more closing slashes on tags, no more
</li>'s, </td>'s, </dd>'s and </dt>'s etc. i can't see any downsides at all to changing back to HTML. anyone know any?
reduce the guesswork for the UA, are cleaner and easier to parse
You're right, because there are some browser bugs to watch out for, but as long as you browser test (which you have to anyway when using CSS) it shouldn't be a problem.
AND are more likely to be compatible with future markup versions
It's very unlikely that new versions of HTML will change the current syntax rules imho.
i can't see any downsides at all to changing back to HTML. anyone know any?
You can't easily include MathML, SVG etc. As long as you don't need to do this: no drawbacks.
I have a related question: Opera -- yes, I know there's an Opera forum in WebmasterWorld -- complains about one particular page of html strict saying that it is not xhtml. I have to add the closing slash to those elements that don't take a closing tag and, this is strange, I have to put a space between attributes (example: instead of onload='blah'onmouseover='blah', I have to have onload='blah' onmouseover='blah'). Have you guys run across this and what is the relationship between attributes without whitespace and xhtml?
Edit update:
I just took a look at HTML 4.01. I never noticed that for so many elements, a closing tag is optional -- but I guess you gurus knew that -- I just automatically put them in.
[edited by: MarkFilipak at 4:53 am (utc) on Mar. 16, 2008]
For example, border=1 and border="1" are equally valid.
But, let me tell you this -- from years of experience -- that nothing bad has ever come out of being consistent. I always quote (using double quotes) all attributes, and I always use closing tags where available.
Quite contrary ... it has caused headache when people have not done so, making assumptions about the surrounding markup or values of given attributes.
The benefit from XHTML is just that -- clean markup. But there's nothing preventing us from having that same clean markup while utilizing HTML. In fact, it is preferred to do so.
[New versions of HTML] are likely to require closing tags for all elements.
Hi DrDoc,
The HTML5 Draft retains [w3.org] the current rules on optional end (and start) tags. What makes you think HTML6+ will change this?
The initial statement was that by including optional closing tags, and always using double-quoted attributes, the produced markup is "more likely to be compatible with future markup versions" ... such as XHTML/XML/etc.
I realize that the next poster then responded by limiting the applicability to plain HTML, which then caused my initial intentions behind the statement to be misunderstood.
The fact of the matter is that W3C is moving closer and closer to the stricter XML type syntax. Even HTML5 itself proves this by being extremely detailed with regards to when and when not end tags are optional. Anything that simplifies the syntax is good for both developers and UA providers alike. Strict markup and strict development habits are superbly beneficial, even if not currently realized.
Don't let short term gain blind you from the long term benefits. Of course, it is up to each of us to determine where the future is going to take us, and thereby evaluate the needs carefully. However, if that path is yet uncertain, the decision to always include optional closing tags and always use double-quoted attributes might be the most suitable.
[edited by: DrDoc at 6:51 pm (utc) on Mar. 16, 2008]
I close all of my tags now (except for those that don't have closing tags in html: img, meta, link, etc.). My code is cleaner and easier to read and maintain. I would re-iterate what DrDoc said...
Please change back to HTML!
But please keep the closing tags!
The fact of the matter is that W3C is moving closer and closer to the stricter XML type syntax.
To be clear: HTML5 is not moving closer to the stricter XML type syntax. HTML5 retains the current HTML rules on optional opening and closing tags. Valid HTML4.01 will be conformant HTML5, with a few small exceptions (some presentational attributes have been removed).
Even HTML5 itself proves this by being extremely detailed with regards to when and when not end tags are optional.
HTML5 retains the current rules but precisely defines them (and all the other rules) for the first time. Only XHTML5 requires well-formed XML syntax, though I do accept that closing non-empty tags in HTML is a widespread de facto standard. Incidentally, HTML5 also allows closing empty tags too i.e. <img ... /> and <img ... > are both conformant HTML5.
Avoid that format with HTML 4.01, especially with <meta> tags.
Do use closing tags on paragraphs, lists, and tables. You can sometimes get interesting CSS style bleed-over effects if you miss some out.
Once we see better support for XSTL the choice should be to go from XHTML to XML, not back to HTML.
If you plan on using any third party applications and want to merge them seamlessly with your new site and have it validate too, then I do believe your best option now is to stick with the XHTML. Yes? No?
I too jumped on the XHTML bandwagon. Switched one site back to HTML 4.01 Strict and then switched it back to XHTML 1.0 Strict. Arrrggghhh! Make up your minds, would ya? ;)