Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
HTML
XHTML
Hmm, XHTML is a stricter version html and are almost the same except some differences. XHTML is there to prevent "bad" html coding.
Some things like <!DOCTYPE is mandatory in XHTML. also it enforces some other rules such as lower case on attribute names.
Both describe the structure of web pages using mark up. Well mainly in a xml format.
Following example demonstrate the difference b/w HTML and XHTML:
HTML example
-----------------
<img alt="Loren ipsum" src="/images/abc.jpg">
<p lang="fr">Loren ipsum.</p>
<p><cite class="title">Loren ipsum</cite></p>
====================================
XHTML example
-----------------
<img alt="Loren ipsum" src="/images/abc.jpg" />
<p xml:lang="fr">Loren ipsum.</p>
<p><cite class="title">Loren ipsum</cite></p>
=======================
Notice the difference: <p xml:lang="fr"> in XHTML
Comparing HTML(Hypertext Markup Language) and XHTML(Extensible HTML) could be like comparing identical twins.since there are only a few minor point.
Implementation Point of view differents is;
1. Tag minimization
HTML does not require all elements to have closing tags.
Of course, in XML this document would be malformed because the <p> element is not closed.
2. Case sensitivity.
HTML is case insensitive, but XHTML (as all XML) is case sensitive.
3. Empty Element Syntax
The syntax for empty elements is different.
In HTML, empty element syntax is <elementName>
In XHTML empty element syntax is <elementName />
4. Attribute Values
Attribute values must be enclosed by single or double quotes.
In HTML, this is allowed: <meta name=keywords>
In XHTML it must read <meta name="keywords" /> or <meta name='keywords' />
5. Boolean attributes
Minimized attributes are now allowed in XHTML/XML
In HTML, a boolean attribute could be expressed <p nowrap>
In XHTML, is must read <p nowrap="nowrap">
6. Fragment Identifiers
Many existing HTML clients don't support the use of ID-type attributes in this way, so identical values may be supplied for both of these attributes to ensure maximum forward and backward compatibility:
<a id="target1" name="target1">...</a><br/> <br/>
Le HTML est un langage qui évolue. Plusieurs versions se sont succédées : HTML 1, HTML 2, HTML 3 puis HTML 4.
Le XHTML 1 (Extensible Hypertext Markup Language) est apparu peu après le HTML 4. Il s'agit en fait d'une reformulation plus rigoureuse du HTML. Seule la syntaxe change, les fonctionnalités sont les mêmes.
Le choix est fait dans ce cours d'utiliser le XHTML pour la création de pages Web.Ceci pour les raisons suivantes :