View Full Version : Xhtml


vanilla192
03-14-2005, 12:00 AM
what is all this XHTML i keep hearing about? how is it better? and is it much different that normal HTML? thanks, vailla192.

Monkey Bizzle
03-14-2005, 12:04 AM
well, XHTML is the next version of HTML. If you use a blogging software for example, you will notice that it codes in XHTML because regular HTML is phasing out. I am sure there are LOTS of differences between it and regular HTML but here are the ones I can think of.

Instead of doing just <p> for a new paragraph, you have to start the paragraph with <p> and end it with </p>. <br> becomes <br />, <img> becomes <img />, etc. Basically, every tag has to be closed.

Also, you HAVE to write your tags in lowercase letter. So, <TABLE> would be incorrect. you also have to make sure you quote all your values. <font size=7 family=Arial> is incorrect, it would have to be <font size="7" family="Arial">

wergo
03-14-2005, 12:15 AM
xhtml was designed to phase out html and make it easier to migrate to xml. the syntax for xhtml is much stricter to that of html. you can get away with alot of things with html so there are alot of sites out there with improper coding in html (<b><i>blah</b></i>)and end up the page looking so much differently between different browsers. and theres really not that much difference between xhtml and html they both do the same thing which is make up a web document.

MaGiCSuN
03-14-2005, 06:44 PM
Plus a little difference:

tags that don't have a closing tag (such as tags that do have one: <b></b> and <i></i>) need to be closed.

<br> in html
will be </ br> in xhtml

same goes for <img src="blah.gif">
will be: <img src="blah.gif" />

also xhtml is case sensitive. Meaning <BR> will give different results as <br>. In HTML this will almost never make a difference, it both will make a space between sentences. But in xhtml everything should be lowercase.

Also when using <p> you need to close them with </p>. Also something most people don't do in HTML. However it's a paragraph tag, while most of us just see it as a "huge space tag" between sentences.

Everything needs quotes:

<table cellspacing=0>
should be:
<table cellspacing="0">

and last but not least, everything needs to be closed properly like already mentioned before in the thread. But that also should be done in html, cause most browsers already give an error with that in regular HTML aswell...

<b><i><strike>blah</strike></i></b>

read more:
http://www.w3schools.com/xhtml/
http://www.xhtml.org/

However don't feel like you MUST use xHTML to code properly. Quotes and properly ending tags should ALWAYS be used, no matter if you use HTML or xhtml.

Love,
Mirna