Jump to content


Photo

HTML XHTML? Any difference?


  • Please log in to reply
151 replies to this topic

#141 suryaworldedu

suryaworldedu

    Member

  • New Members
  • PipPip
  • 10 posts
  • LocationIndia

Posted 07 June 2011 - 02:22 AM

    * XHTML elements must be properly nested
    * XHTML elements must always be closed
    * XHTML elements must be in lowercase
    * XHTML documents must have one root element
In HTML, some elements can be improperly nested within each other, like this:
<b><i>This text is bold and italic</b></i>
In XHTML, all elements must be properly nested within each other, like this:
<b><i>This text is bold and italic</i></b>

#142 jamesjmann

jamesjmann

    Advanced Member

  • Members
  • PipPipPip
  • 245 posts

Posted 30 December 2011 - 01:32 AM

In a nutshell, XHTML is the same as HTML but with a few differences that make it more "robust":

  • All tag names must be lowercase - i.e. <html> instead of <HTML>)
  • All elements must have corresponding closing tags - i.e. <p>paragraph</p> instead of <p>paragraph
  • Elements without closing tags should use /> - i.e. <br /> and <img src="..." /> instead of <br> and <img src="...">
  • All attributes must be in quotes - i.e. <span class="test">something</span> instead of <span class=test>something</span>
  • All attributes that are used must have values - i.e. <option selected="selected"> instead of <option selected>


Question: I use SELECTED and often times don't give my attributes values. I code in HTML (not XHTML). Can I get away with doing this coding in either?

#143 casper_ghost

casper_ghost

    Member

  • Members
  • PipPip
  • 13 posts

Posted 02 January 2012 - 10:30 AM

isn't xhtml dead now they have moved away from it and back to html?

#144 rohitnanda

rohitnanda

    Newbie

  • New Members
  • Pip
  • 5 posts

Posted 05 January 2012 - 07:11 AM

There are three areas in which the differences between HTML and XHTML affect our use of CSS:

case sensitivity.
optional tags.
properties for the root element.


#145 kevinblevins

kevinblevins

    Member

  • New Members
  • PipPip
  • 11 posts

Posted 17 January 2012 - 02:45 AM

XHTML is the same as HTML but with a few differences that make it more "robust":
All tag names must be lowercase - i.e. <html> instead of <HTML>)
All elements must have corresponding closing tags - i.e. <p>paragraph</p> instead of <p>paragraph
Elements without closing tags should use /> - i.e. <br /> and <img src="..." /> instead of <br> and <img src="...">
All attributes must be in quotes - i.e. <span class="test">something</span> instead of <span class=test>something</span>
All attributes that are used must have values - i.e. <option selected="selected"> instead of <option selected>

spam removed

#146 Who8MyFish

Who8MyFish

    Member

  • Members
  • PipPip
  • 28 posts

Posted 11 April 2012 - 04:56 PM

What separates pros from amateurs is that the former group knows why and when to use a specific tool. Just saying.



What separates pros from amateurs is that the former group often needs to reassure themselves and that they are not the latter group by being unnecessarily condescending to the former group.
Anyone else sick of admins and their over the top hubris? You passed on a perfect opportunity to help someone learn something so you could lay down that half assed troll.

Douche bag.


#147 BuildMyWeb

BuildMyWeb

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts
  • LocationNY

Posted 17 May 2012 - 08:03 PM

Question: I use SELECTED and often times don't give my attributes values. I code in HTML (not XHTML). Can I get away with doing this coding in either?


depends upon STRICT vs TRANSITIONAL

Freelance Web Developer | Web Hosting | PHP Applications
Web Development, Hosting, Graphic Design, SEO


#148 heinkasner

heinkasner

    Newbie

  • New Members
  • Pip
  • 7 posts

Posted 22 May 2012 - 02:54 AM

I believe XHTML is a bit more dynamic than normal HTML.

#149 haku

haku

    Advanced Member

  • Staff Alumni
  • 6,172 posts

Posted 22 May 2012 - 07:56 AM

Please do elaborate.

#150 Pikachu2000

Pikachu2000

    I hate everything.

  • Staff Alumni
  • 11,378 posts
  • LocationFuture Independent Republic of Texas
  • Age:106

Posted 26 June 2012 - 08:17 AM

XHTML is same a HTML , We can find few difference in closing tags, attributes, elements, etc. 


If there are differences, then it isn't the same, now is it?
"Java" is to "Javascript" about the same as "fun" is to "funeral".

Why $_SERVER['PHP_SELF'] is bad. || Why ORDER BY RAND() is bad || Every problem can be solved with rm -rf *

Random Quote: "

#151 rythemton

rythemton

    Advanced Member

  • Members
  • PipPipPip
  • 107 posts

Posted 29 July 2012 - 05:03 PM

isn't xhtml dead now they have moved away from it and back to html?

I use XHTML convention when I create HTML 5 pages. I find that my web page coding is cleaner. There is also XHTML 5, which is just HTML 5 with XHTML rules added, but I don't use it because I don't know how supported it is.

I personally like XHTML. It makes code much cleaner, which makes it easier to troubleshoot other people's code. I think it was a mistake for HTML 5 to allow sloppy coding!
Strangely enough, I learn more from my failures than I do from my successes. Unfortunately, my boss does not consider work a learning experience!

#152 Adam

Adam

    Advanced Member

  • Gurus
  • 5,683 posts
  • LocationSheffield / UK

Posted 19 November 2012 - 08:07 PM

There is also XHTML 5, which is just HTML 5 with XHTML rules added, but I don't use it because I don't know how supported it is.


I realise this an old quote, but I've only just seen it. "XHTML5" is not supported in any way shape or form by any respectable authority, especially not the W3C.

I personally like XHTML. It makes code much cleaner, which makes it easier to troubleshoot other people's code. I think it was a mistake for HTML 5 to allow sloppy coding!


HTML5 doesn't "allow" sloppy coding, sloppy coders do. Are you trying to say every XHTML declared document you've come across is easy to read? I don't see any justification for HTML documents to be strictly XML-compliant.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com