Forum Moderators: open
I am about to re write my very messy site html and was wondering if it was worth doing it over in XHTML instead of HTML 4.1
Can the main browsers work pretty much the same with XHTML? Is there anything i have to watch out for?
Also, which version should i use, 1.0 or 1.1?
Finally, what is the currently and most widely supported CSS, is it v1.1?
Thanks for any info :)
Thing that is different with XHTML 1.x and normal HTML 4.0: For Flash movies I used to use 'embed' tags to show the contents in Firefox. This however is not valid XHTML. You'll have to use the Flash Satay method for that:
First link in Google when searching for "Flash Satay".
Now, that said, if you wish to become more comfortable with the xhtml style, which is html reformulated with xml, you can use it just fine. xhtml will, one day, replace html. Version 1.1 is xhtml modularized but I wouldn't use it at this time.
There is no css1.1, only css1, but there is a 2.1 and 3. Technically, 2.1 is not finished but browsers support most of it. IE does a horrible job while the others are pretty good with it and have even moved on to css3 support. If you google you can find pages that show any inconsistencies/support for css2.1 but I think most people code to it.
You can google to find ways to embed flash which validates.
Use HTML 4.01 Strict.
That would be my suggestion too. After taking the route of validating XHTML 1.1 Strict and then realizing that there were some major issues after the fact, I then dropped back to XHTML 1.0 Strict. After working with that for quite some time, I switched back to HTML 4.01 Strict.
I value the member input here at the board. Many were suggesting that we stay with HTML 4.01 Strict as it is pretty much the middle ground and you are safe either way.
Don't worry, it's an easy change switching over to XHTML 1.0 Strict if you are HTML 4.01 Strict now. A few Find and Replace routines and you're good to go.
there are workable ways to serve xhtml to browsers that can accept it, and reformat the code to html for IE, but for the average website its not worth it.
I hope this link is acceptable:
XHTML 1.0 is the W3C's first Recommendation for XHTML, following on from earlier work on HTML 4.01, HTML 4.0, HTML 3.2 and HTML 2.0. With a wealth of features, XHTML 1.0 is a reformulation of HTML 4.01 in XML, and combines the strength of HTML 4 with the power of XML.
As taken from:
[w3.org...]
Firefox is rapidly growing and now accounts for around 20% of the browser market.
IE may be broken and behind the game, but it does accept XHTML served as html - even if it treats it as tag soup.
Maybe it is worth following w3c recomendations.
It is always worth validating pages at [validator.w3.org...] to find silly mistakes from hand coding
Firefox is rapidly growing and now accounts for around 20% of the browser market.
Not quite 20%, but IE is still the 800 pound gorilla among the browsers and doesn't support XHTML now nor in the near future.
IE may be broken and behind the game, but it does accept XHTML served as html - even if it treats it as tag soup.
That's more a reason to avoid XHTML for now. If the browser is not going to interpret XHTML as XHTML but malformed HTML instead, then there is no point in using XHTML to begin with because you lose all the advantage of using XHTML.
Maybe it is worth following w3c recomendations.
The W3C got ahead of themselves with XHTML. The web wasn't ready for XHTML and still isn't ready for XHTML. Right now XHTML is a bridge to far.
It is always worth validating pages at [validator.w3.org...] to find silly mistakes from hand coding
And if you can't do it the right way to begin with, then you shouldn't be doing it in at all. Using XHTML with the text/html MIME type defeats one of the principle goals of a webdeveloper, to create webpages which are as error free as possible.
Doing XHTML the right way means telling IE to get lost, but that is very unprofessional.
[edited by: encyclo at 6:16 pm (utc) on Dec. 10, 2005]
[edit reason] language [/edit]
When HTML 4.01 is no longer recognizable to most browsers, I will take 5 more minutes and put em' back.
This issue all of a sudden seems less of a big deal than before to me?
application/xhtml+xml is a terrible idea to put in place on anything other than a test page). One advantage of using XHTML 1.0 Strict is that it is easier to validate for a non-experienced user. Every tag must be closed in XHTML (can you remember all the exceptions in HTML?) and so coding "errors" which would pass HTML validations are more easily spotted with XHTML. For example:
<table border="1">
<tr>
<td>HTML vs. XHTML</td>
</tr>
<tr>
<td>Can you see the error?<td>
</tr>
</table> The above is valid HTML 4.01 (OK, ignore the border attribute if you are using Strict!), but invalid XHTML: XHTML helps you get what you want, as you are unlikely to deliberately write the above.
As for future conversion, moving from HTML syntax to XHTML syntax is pretty easy, moving from HTML to XHTML as XML is a great deal harder than you would imagine.
<table border="1">
<tr>
<td>HTML vs. XHTML</td>
</tr>
<tr>
<td>Can you see the error?<td>
</tr>
</table> Should be...
<table summary="Short summary of table contents.">
<tbody>
<tr>
<td>HTML vs. XHTML</td>
</tr>
<tr>
<td>Can you see the error?</td>
<td>Do I get a prize or something? ;)</td>
</tr>
</tbody>
</table>
colspan in your example. ;) In fact, the problem with the example is that as a </td> is optional in HTML (but obligatory in XHTML) then it can be harder to debug tables when using HTML 4.01 - the final <td> creates a new unwanted table cell and the validator won't pick it out. One other use for XHTML is when the tools or scripts you are using default to it: the PHP line-break function uses XHTML syntax, as do many CMS and other code-generation tools. It is often better to stick with XHTML 1.0 throughout rather than trying to rewrite the CMS code.
But like I said, I still prefer HTML. :)
Oh, the fundamental problem with Encyclo's example, he attempts to use a one cell wide table when he should have used two divs--two paragraphs would have worked as well, but ended up with an unintentional, empty second cell in the second row ;)
If you have the ability to manipulate your .htaccess or use serverside code (such as PHP) and really want to learn and even master the latest and greatest go with XHTML but ensure you're serving the mimetype correctly.
<?php header("Content-type: application/xhtml+xml");?>
Of course you'd need to NOT serve this mimetype to IE...you could do a couple things...perhaps a new thread about whether you can use XHTML tags and change the doctype for IE via serverside...what would work best...hmm.
Also if you validate your stuff, (X)HTML, CSS, 508, WAI then when you change the mimetype so long as your stuff validates you should NOT have a major problem with anything save perhaps badly/uninformed written JavaScript.