Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Xhtml

Extensible hypertext markup language,rules and syntaxes

  • Inicia sesión para ver los comentarios

Xhtml

  1. 1. XHTML BY SANA MATEEN
  2. 2. • XHTML stands for EXtensible HyperText Markup Language • XHTML is almost identical to HTML • XHTML is stricter than HTML • XHTML is supported by all major browsers • Why Use XHTML? • XHTML documents are XML conforming as they are readily viewed, edited, and validated with standard XML tools. • XHTML documents can be written to operate better than they did before in existing browsers as well as in new browsers. • XHTML documents can utilize applications such as scripts and applets that rely upon either the HTML Document Object Model or the XML Document Object Model. • XHTML gives you a more consistent, well-structured format so that your webpages can be easily parsed and processed by present and future web browsers. • You can easily maintain, edit, convert and format your document in the long run. • Since XHTML is an official standard of the W3C, your website becomes more compatible with many browsers and it is rendered more accurately. • XHTML combines strength of HTML and XML. Also, XHTML pages can be rendered by all XML enabled browsers. • XHTML defines quality standard for your webpages and if you follow that, then your web pages are counted as quality web pages. The W3C certifies those pages with their quality stamp.
  3. 3. The Most Important Differences from HTML: • Document Structure • XHTML DOCTYPE is mandatory • The xmlns attribute in <html> is mandatory • <html>, <head>, <title>, and <body> are mandatory • XHTML Elements • 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 • XHTMLAttributes • Attribute names must be in lower case • Attribute values must be quoted • Attribute minimization is forbidden
  4. 4. <!DOCTYPE ....> Is Mandatory • An XHTML document must have an XHTML DOCTYPE declaration. • A complete list of all the XHTML Doctypes is found in our HTML Tags Reference. • The <html>, <head>, <title>, and <body> elements must also be present, and the xmlns attribute in <html> must specify the xml namespace for the document. • This example shows an XHTML document with a minimum of required tags:
  5. 5. XHTML Elements Must Be Properly Nested • 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>
  6. 6. XHTML Elements Must Always Be Closed • This is wrong: • <p>This is a paragraph <p>This is another paragraph • This is correct: • <p>This is a paragraph</p> <p>This is another paragraph</p>
  7. 7. Empty Elements Must Also Be Closed • This is wrong: • A break: <br> A horizontal rule: <hr> An image: <img src="happy.gif" alt="Happy face"> • This is correct: • A break: <br /> A horizontal rule: <hr /> An image: <img src="happy.gif" alt="Happy face" />
  8. 8. XHTML Elements 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> XHTMLAttribute Names Must Be In Lower Case • This is wrong: • <table WIDTH="100%"> • This is correct: • <table width="100%">
  9. 9. Attribute Values Must Be Quoted • This is wrong: • <table width=100%> • This is correct: • <table width="100%">
  10. 10. Attribute Minimization Is Forbidden • Wrong: • <input type="checkbox" name="vehicle" value="ca r" checked /> • Correct: • <input type="checkbox" name="vehicle" value="ca r" checked="checked" />
  11. 11. How to Convert from HTML to XHTML • Add an XHTML <!DOCTYPE> to the first line of every page • Add an xmlns attribute to the html element of every page • Change all element names to lowercase • Close all empty elements • Change all attribute names to lowercase • Quote all attribute values

×