We can say that to some extend xHTML is as same as HTML 4.01 with very less but most important differences.
xHTML is more strict version than HTML 4.01. So ofcource if you wish to learn the xHTML you must know HTML. Then only you will find xHTML very easy to learn.
xHTML stands for extensible hypertext language which is the application of XML. It helps in internet revolution.
Here are some important differences between HTML and xHTML.
- In xHTML DOCTYPE is mandatory
- Add xmlns attribute to the html element in evry page.
- Basic tags like <html>, <head>, <title>, <body> are mandatory in every page with its closing tags.
- xHTML elements must be properly nested and closed.
e.g. <b><u>webmastersun.com</u></b> is right where
<b><u>webmastersun.com</b></u is wrong.
- All tags and attributes in xHTML must be in lower case.
- Attribute values must be quoted.
- Attribute shortcut or minimization is not allowed in xHTML.
e.g. <input checked="checked"> is right where
<input checked> is wrong.
- All empty elements of HTML must be closd in its start tag itself.
e.g. a horizontal line </hr> is right
a horizontal line <hr> is wrong
In short xHTML is a strict version of HTML 4.01. That means HTML is exactly opposite to the xHTML, the above rule can be break in HTML very easily but if you do so your website may not show the proper result in internet or may not be validated by well known browsers. So its better to always follow the above xHTML rules.
Web design beginner here, but I have been using HTML for quite a while now. I have not tried xHMTL though.
Frankly speaking, I have no idea how xHMTL is different with HTML. Of course, I've been I know it is better than HTML as it I've heard it makes more dynamic web page.
Here, I want to ask...
What exactly is/are the difference between HTML and xHTML?