This is a discussion on "[SOLVED] HTML or XHTML" within the Web Page Design section. This forum, and the thread "[SOLVED] HTML or XHTML are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] HTML or XHTML
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
||||
|
[SOLVED] HTML or XHTML
Hi guys,
I have read the article about choosing the right doctype in newsletter, what i want to know that if i don't use xhtml then what will i lose ? Thanks...
__________________
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
|
|
|
|||
|
Re: HTML or XHTML
Well, do you mean Strict vs. Transitional or do you mean HTML vs XHTML?
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
|
|
|||
|
Re: HTML or XHTML
Nothing.
...except an "X". |
|
||||
|
Re: HTML or XHTML
Oooh I hear a big debate about tag soup coming along...no?
Generally, if you're not using any of the XML features with XHTML, HTML 4.01 Strict is perfectly suitable.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
||||
|
Re: HTML or XHTML
and neater code - the brawl begins
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
||||
|
Re: HTML or XHTML
Well in my opinion, the code is as neat as the autor writes it.... You can have a compliant XHTML document that is bloated with unnecessary code and a HTML document that has been written without a single element in excess.
I always use XHTML due to the fact that it is a XML version of HTML. All of the HTML elements are still available but can also be parsed as XML due to the uniform structure required by such documents. I write applications with PHP and having all documents coded in XHTML allows me to use PHP's XML parsing functions to read it, parse it and manipulate it like any other XML document. As ASO says, if you don't plan to use the XML features there aren't any killer features to make one standard recommendation better than another. XHTML has addition benefits when it comes to accessibility and devices that don't use a standard web-browser interface. A correctly written XHTML document can easily be used to generate output on text-brailes devices and any program that can parse XML. Having said that though, HTML will also do the same. The difference is that XHTML by its recommendation requires a strict, properly formed layout whereas HTML is not quite as firm in this enforcement. Any compliant XHTML document will can be translated but this isn't the same for HTML. If you use HTML and find yourself slipping into lazy or messy practices, switching to XHTML is a good way of forcing yourself into correctly structured documents as your code won't validate any other way... Hope that helps a little.
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Last edited by Rakuli; Dec 18th, 2007 at 12:13. Reason: spelling error :o |
|
||||
|
Re: HTML or XHTML
Thnx guys,
So what i understand now is that if i dont need xml then i should use html strict 4.01, right ?
__________________
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
|
||||
|
Re: HTML or XHTML
No it's nothing to do with XML besides the rules that (almost) ever element must be closed.
It doesn't matter whether you use XHTML or HTML just use a strict doctype
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
|
|
|||
|
Re: HTML or XHTML
Quote:
As Alex said, the really important decision is to use a Strict doctype. And as Rakuli said, the quality of your code is unconnected to whether you use XHTML. XHTML has certain pitfalls, which I listed in the article (the need for content negotiation, problems with google ads, and the "invalid user comment breaks entire page" issue). All of these problems can be overcome. I don't find it to be worth the effort, given I have no use for XHTML over HTML. But if you are aware of the issues, there's nothing wrong with using XHTML. Assuming, of course, that you're serving it with the correct MIME type -- otherwise it becomes invalid HTML, which seems a little stupid, no? Last edited by MikeHopley; Dec 18th, 2007 at 08:18. |
|
||||
|
Re: HTML or XHTML
Ok, How you guys choose your doctypes ? i mean what factors are important for you to choose html or xhtml ?
__________________
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
|
|||
|
Re: HTML or XHTML
Quote:
My approach:
|
|
||||
|
Re: HTML or XHTML
Thanks Mike,
Now i think i got it !
__________________
Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
|
|
|||
|
Re: HTML or XHTML
Quote:
I was all for HTML 4.01 - but - there's no winning. I have not met somebody who has not wanted XHTML in their site. People refer to it (HTML) as "old technology" - it's not, I know, but times do change and it's just like with everything. I can easily spot that XHTML is the way everything is going, so rather sooner than later. Thanks, Ed
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
|
|
|||
|
Re: HTML or XHTML
Your comments sound all too familiar to my jaded ears.
My article "Choosing the best doctype for your website" covers these arguments in detail. XHTML offers me nothing that I (yet) desire, and it does pose some potential problems. I find the very idea of "learning" XHTML risible. What is there to learn? Its syntax hardly differs from HTML. I've already "learned" XHTML: it took me all of an hour or so; it only took so long because everyone else uses text/html (fools), so it was hard to find a valid example to work from. Since 80% of visitors use a browser that has no support for XHTML, I'm in no hurry to use it. What's the point of serving them invalid HTML, when I can use valid HTML instead? So this is what I would get from XHTML:
|
|
||||
|
Re: [SOLVED] HTML or XHTML
Interesting. I use xHTML Transitional. Is this still acceptable? You guys have me concerned now :P
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
||||
|
Re: [SOLVED] HTML or XHTML
Jack, I would never, ever, ever recommend using Transitional - always Strict wither it be with HTML or XHTML.
|
|
||||
|
Re: [SOLVED] HTML or XHTML
Thats fair enough, but how come?
__________________
Resources Administrator
Grilling Gurus - Interviews with the Best Web Designers and Developers in the Industry Got a Question for Ryan Carson and his Web Design/Development team Carsonified? Jack Franklin - My Blog (It's a Pen in My Mouth BTW)
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
|
|
||||
|
Re: [SOLVED] HTML or XHTML
I think that Mike is being somewhat pessimistic about XHTML even though his points are valid.
There are issues with XHTML? Yes. Will they destroy your website? I think not. Tag soup is not so much a problem with XHTML -- the extensible part of XHTML means having HTML tags treated as XML; technically, they can be placed anywhere in a logical XML structure and still form a valid XML ocument -- but semantic web design means that tag soup websites are simply those that use HTML elements outside of their correct context. CSS support in HTML allows a tag soup approach to coding in HTML 4.x documents as well. Consider the designer who uses CSS to style a semantically neutral <span> into a H1 heading and styles the <h1> tag down to a H6, placing it at the very bottom of the document. "Tag-soup" essentially means that HTML tags are used without concern for their intended purpose, the XHTML standard accounts for this. You cannot use a <title> tag in the <body> and you can't place a body in the <head>. XML would allow this provided the document was correctly formed but XHTML is merger of XML and HTML meaning that the document must be correctly formed and valid HTML. As I mentioned above I always use XHTML strict or transitional (depending on whether I need to use the target attribute ) and have not encountered any problems with google ads or browser error handling. Mike's concerns are valid but biased towards his preference -- exactly the same as my arguments favour my preferred option. I just wanted to point out that XHTML is not going to destroy your web design career whether you use the XML features or not and, in my humble opinion, a standard that enforces correct formedness in documents is never a bad thing. Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
|
|
|||
|
Re: [SOLVED] HTML or XHTML
"Tag soup" is actually such a generic phrase now that calling something "tag soup" just means "this code is messed up".
The reason you don't encounter problems with browser error handling is that browsers are good at handling errors. They've had a lot of practice. Your "XHTML" is invalid HTML unless you send it as "application/xhtml+xml". Not disastrously invalid, but invalid nonetheless. I've always said that XHTML is fine to use. Obviously it's not going to destroy your web design career. Used carefully, it's harmless -- as long as you don't mind your code being interpreted as invalid HTML. I just think it's a daft choice for most websites. Mozilla, Opera, and Safari all recommend using HTML 4.01 rather than XHTML. Last edited by MikeHopley; Dec 23rd, 2007 at 10:01. |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| XHTML V2 vs. HTML V5 | c010depunkk | Webforumz Cafe | 1 | Dec 17th, 2007 08:23 |
| xhtml , html | leckenby15 | Web Page Design | 3 | May 30th, 2007 14:05 |
| Converting from HTML to XHTML | Aaron1988 | Web Page Design | 1 | Dec 4th, 2006 15:09 |
| help with converting HTML to XHTML | sing2trees | Web Page Design | 4 | Sep 20th, 2006 03:35 |
| Learning HTML/XHTML | Amari | Web Page Design | 3 | Jul 1st, 2004 22:05 |