Difference between xhtml and html?

liunx

Guest
What's the difference? Are there any advantages/disadvantages from switching to xhtml from html? Is it hard to convert a page so it validates xhtml? I've never used it before and have no idea what its' used for.<br />
<br />
Josh<!--content-->Josh,<br />
W3 Schools' (<!-- m --><a class="postlink" href="http://www.w3schools.com/xhtml/default.asp">http://www.w3schools.com/xhtml/default.asp</a><!-- m -->) tutorial on XHTML includes a section that explains the differences between XHTML and HTML and the advantages of using XHTML. And it isn't really very difficult to change a site over.<br />
<br />
HTH<!--content-->XHTML is basically the same as HTML except with stricter coding rules i.e tags that don't have associated closing tags should have a forward slash at the end such as <p />. All code should be in lowercase, etc.<br />
<br />
Basically it helps to make your web pages more cross browser/platform friendly. IE allows for sloppy coding but other browsers such as Netscape don't.<!--content-->I just changed the doctype tag on one of my valid html pages and have 100's of errors. I don't even know what most of them mean. I guess if I were to make a valid html page, it would be better to start from scratch? Most errors are the same.<br />
<br />
<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.joshmccrain.com%2Fautographs.htm">http://validator.w3.org/check?uri=http% ... graphs.htm</a><!-- m --><!--content-->OK, i fixed almost everything.<br />
<br />
Only 8 errors left, and I"m not sure what to do with them.<br />
<br />
<!-- m --><a class="postlink" href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.joshmccrain.com%2Fautographs.htm&charset=%28detect+automatically%29&doctype=%28detect+automatically%29">http://validator.w3.org/check?uri=http% ... tically%29</a><!-- m --><!--content-->Only three when I looked now.<br />
<br />
<br />
Nice job on coding and validation, but some browsers aren't really ready for XHTML yet, and have problems depending which MIME-type the page is served with. I know that the Infernal Exploder can totally freak out on what is supposedly the "correct" MIME-type.<br />
<br />
<br />
<br />
You have loads of inline style commands, which makes a lot of code bloat. Gather them all up and put them into an external stylesheet. You'll save loads of bandwidth and make changing the look of the site in future a whole lot easier too.<br />
<br />
<br />
<br />
You need to update this code:<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"http://validator.w3.org/check/referer"><img border="0"<br />
src=http://www.htmlforums.com/archive/index.php/"http://www.w3.org/Icons/valid-html401"<br />
alt="Valid HTML 4.01!" height="31" width="88" /></a> </p><br />
<br />
<br />
<br />
.<!--content-->Originally posted by giz <br />
Only three when I looked now.<br />
<br />
<br />
Nice job on coding and validation, but some browsers aren't really ready for XHTML yet, and have problems depending which MIME-type the page is served with. I know that the Infernal Exploder can totally freak out on what is supposedly the "correct" MIME-type.<br />
<br />
<br />
<br />
You have loads of inline style commands, which makes a lot of code bloat. Gather them all up and put them into an external stylesheet. You'll save loads of bandwidth and make changing the look of the site in future a whole lot easier too.<br />
<br />
<br />
<br />
You need to update this code:<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"http://validator.w3.org/check/referer"><img border="0"<br />
src=http://www.htmlforums.com/archive/index.php/"http://www.w3.org/Icons/valid-html401"<br />
alt="Valid HTML 4.01!" height="31" width="88" /></a> </p> <br />
<br />
So are you saying I shouldn't use xhtml?<br />
<br />
I'm not sure how to fix those 3 errors.<br />
<br />
And you're saying I should put my css in an external style sheet? I'm not too sure on how to do that, I'll look around on w3schools.<br />
<br />
And I'll fix that code when I get this valid.<!--content-->Personally I use it, but you have to be careful. One problem is with MIME types.<br />
XHTML should be served as application/xhtml+xml instead of text/html, however, that causes problems with IE: <br />
<!-- m --><a class="postlink" href="http://www.hixie.ch/advocacy/xhtml">http://www.hixie.ch/advocacy/xhtml</a><!-- m --><br />
<!-- m --><a class="postlink" href="http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html">http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html</a><!-- m --><br />
<br />
Another problem IE has with XHTML is with the first line of code (the XML declaration, which looks like <?xml version="1.0" encoding="encoding"?>) many XHTML documents have. Including this line triggers IE into Quicks Mode, even if you include a valid XHTML doctype.<br />
<br />
You're better off omiting the XML declaration.<!--content-->he he he those last 3 errors... i had them yesterday as well... just put everything in lowercase so onfocus, onblur, onmouseover, onmouseout ;) <br />
<br />
Like everyone else said... XHTML is more strict with deprecated attributes and tags. Make sure you got alt tags in images, closing tags on everything including <br> = <br /><br />
<br />
hth<!--content-->the only reason at the moment to get xhtml under you belt is to perfect your coding skills, otherwise there's no point until it's fully supported.<br />
I think Zeldman gave the best thoughts on xhtml:<br />
<br />
<br />
"Many designers will likely ignore XHTML 2 when it is finalized. Many will continue to ignore it as browsers begin to support it. Based on past acceptance speeds, many might well ignore XHTML 2 even when all new browsers and devices support the spec correctly and completely (if that ever happens). They might stop ignoring it only when 98% of their audience sports an XHTML 2 compliant browser or device. And even then, they might continue to use XHTML 1 or HTML 4 it if they find XHTML 2 too difficult to work with or insufficiently beneficial relative to the difficulty of transition..."<!--content-->I am sticking with valid HTML 4.01 Transitional until there is a really compelling need to be doing anything else instead.<!--content-->Originally posted by giz <br />
I am sticking with valid HTML 4.01 Transitional until there is a really compelling need to be doing anything else instead. <br />
<br />
OK, but should i not use the xhtml and just stick with html? I think i'll make this one page valid xhtml, and all of the others valid html. <br />
<br />
thanks everyone<!--content-->Got it valid! Go me!!!!!!!!!!!!!:banana: :banana: :banana: <br />
<br />
<!-- m --><a class="postlink" href="http://validator.w3.org/check?verbose=1&uri=http%3A//joshmccrain.com/autographs.htm">http://validator.w3.org/check?verbose=1 ... graphs.htm</a><!-- m --><!--content-->Originally posted by hockyfan641 <br />
Got it valid! Go me!!!!!!!!!!!!!:banana: :banana: :banana: <br />
<br />
<!-- m --><a class="postlink" href="http://validator.w3.org/check?verbose=1&uri=http%3A//joshmccrain.com/autographs.htm">http://validator.w3.org/check?verbose=1 ... graphs.htm</a><!-- m --> <br />
of course you didn't have any help ;)<!--content-->do I even need to say thank you to you any more scoutt;) <br />
<br />
But just for the record, thank you.<!--content-->Good work. <br />
<br />
Worth the effort to "do it right".<!--content-->Originally posted by hockyfan641 <br />
do I even need to say thank you to you any more scoutt;) <br />
<br />
But just for the record, thank you. <br />
yes you do, I need to see it on every post you make, even if I didn't have anyhting to do with it. :P LOL <br />
<br />
<br />
<br />
<br />
<br />
nah I was just playing with ya.<!--content-->lmao<!--content-->
 
Back
Top