XHTML or extensive markup language is not very dissimilar from the
HTML or hyper text markup language. In fact, there are loads of
similarities, which puzzles many a brain while lurking the difference
between both.
For sure this seems a daunting task for many IT geeks as well, but
please find what little I’ve written for you to provide a help from my
little bit of knowledge.
Below, I’ve tried providing some of The Most Important Differences:
XHTML Elements Must Be Properly Nested:
In HTML, it may be possible that some elements are improperly nested
within each other, like this:
<b><i>This text is bold and italic</b></i>
while In XHTML, it’s must, that all elements are properly nested
within each other, like this:
<b><i>This text is bold and italic</i></b>
please notice the difference.
this is important, as I’ve seen a lot of people doing this common
mistake, that with nested lists, they forget that the inside list
must be within <li> and </li> tags.
This is wrong:
<ul>
<li>rajasthan</li>
<li>gujarat
<ul>
<li>panjab</li>
<li>maharashtra</li>
</ul>
<li>karnataka</li>
</ul>
This is correct:
<ul>
<li>rajasthan</li>
<li>delhi
<ul>
<li>panjab</li>
<li>maharashtra</li>
</ul>
</li>
<li>karnataka</li>
</ul>
please observe carefully, that I’ve inserted a </li> tag after the
</ul> tag in the correct code example.
XHTML Elements Must Always Be Closed:
Sometimes, we don’t really hassle ourselves closing all the elements in html.
Specially, the tags like <p> (paragraph), <br> (break line), and else.
This sometimes do not produce any strange layout, but while you are
talking about xhtml, it’s worthy taking care about it.
This is wrong:
<p>here is a paragraph
<p>here is another paragraph
This is correct:
<p>here is a paragraph</p>
<p>here is another paragraph</p>
Empty Elements Must Also Be Closed:
Not just those elements which are been filled with some text, but non
empty sort of elements must also be closed properly in xhtml, while
it’s not necessary in html.
This is wrong:
A break: <br>
A horizontal rule: <hr>
This is correct:
A break: <br />
A horizontal rule: <hr />
XHTML Elements Must Be In Lower Case
Tag names and attributes must be in lower case:
This is wrong:
<BODY>
<P>This is a paragraph</P>
</BODY>
This is correct:
<body>
<p>This is a paragraph</p>
</body>
XHTML Documents Must Have One Root Element:
All XHTML elements must be nested within the <html> root element.
Child elements must be in pairs and correctly nested within their
parent element.
The basic document structure goes like this:
<html>
<head> ... </head>
<body> ... </body>
</html>
hope this might has helped you somewhat in clearance of your doubts.
If not, then you’re highly appreciated to ask further, I will try my
level best in assisting you.
Regards,
Prateek agarwal.
Cell: 09928341197
Skype:
Prateek_agarwal32
e-mail:
[email protected]
website:
http://www.prateekagarwal.webs.com
best solution for all your softwares/websites development needs.
You tell, I’ll build.
---------- Original message ----------
From: mukesh jain <[email protected]>
To: accessindia <[email protected]>
Date: Mon, 22 Jun 2009 15:41:50 +0530
Subject: [AI] difference between xhtml and html
hullo list, could anyone please explain me the difference between
xhtml and html? i do know that there is minor difference between this
but could anyone tell me exactly please?
your kind coperation in this regard would be highly obliged.
thanks,
with regards,
mukesh jain.
To unsubscribe send a message to [email protected] with
the subject unsubscribe.
To change your subscription to digest mode or make any other changes, please
visit the list home page at
http://accessindia.org.in/mailman/listinfo/accessindia_accessindia.org.in