O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.


3.689 visualizações

Publicada em

Publicada em: Educação
  • Entre para ver os comentários


  1. 1. XHTML 3
  2. 2. What is XHTML? <ul><li>XHTML stands for E X tensible H yperText M arkup L anguage </li></ul><ul><li>XHTML is the next generation of HTML </li></ul><ul><li>XHTML is aimed to replace HTML </li></ul><ul><li>XHTML is almost identical to HTML 4.01 </li></ul><ul><li>XHTML is a stricter and cleaner version of HTML </li></ul><ul><li>XHTML is a reformulation of HTML into a language that conforms to the XML 1.0 Recommendation </li></ul><ul><li>XHTML Family document types are all XML-based, and ultimately are designed to work in conjunction with XML-based user agents </li></ul>
  3. 3. Why XHTML? <ul><li>XHTML is a combination of HTML and XML </li></ul><ul><ul><li>XML is a markup language where everything has to be marked up correctly, which results in &quot;well-formed&quot; documents </li></ul></ul><ul><li>XHTML consists of all the elements in HTML 4.01 combined with the syntax of XML </li></ul><ul><li>We have reached a point where many pages on the WWW contain &quot;bad&quot; HTML </li></ul><ul><li>XHTML pages can be read by all XML enabled devices </li></ul>
  4. 4. How is XHTML better than HTML? <ul><li>Extensibility: </li></ul><ul><ul><li>it is a metalanguage, which enables one to write a Document Type Definition (DTD) and define the rules of the language so the document can be interpreted by the document receiver . </li></ul></ul><ul><li>Portability: </li></ul><ul><ul><li>much of Internet access could be carried out on non-PC platforms such as palm computers, televisions, automobiles, telephones, etc. </li></ul></ul><ul><ul><li>In most cases these devices will not have the computing power of a desktop computer, and will not be designed to accommodate ill-formed HTML as do current browsers (bloated with code to handle sloppy or proprietary HTML). </li></ul></ul>
  5. 5. Differences Between XHTML and HTML <ul><li>The Most Important Differences: </li></ul><ul><ul><li>XHTML elements must be properly nested </li></ul></ul><ul><ul><li>XHTML documents must be well-formed </li></ul></ul><ul><ul><li>Tag names must be in lowercase </li></ul></ul><ul><ul><li>All XHTML elements must be closed </li></ul></ul>
  6. 6. Elements Must Be Properly Nested <ul><li>In HTML some elements can be improperly nested within each other like this: </li></ul><ul><ul><li><b><i>This text is bold and italic</b></i> </li></ul></ul><ul><ul><li>In XHTML all elements must be properly nested within each other like this: </li></ul></ul><ul><ul><li><b><i>This text is bold and italic</i></b> </li></ul></ul><ul><li>A common mistake in nested lists, is to forget that the inside list must be within an li element </li></ul>
  7. 7. Documents Must Be Well-formed <ul><li>All XHTML elements must be nested within the <html> root element </li></ul><ul><ul><li>All other elements can have sub (children) elements. Sub elements must be in pairs and correctly nested within their parent element. </li></ul></ul><ul><ul><li>The basic document structure is: </li></ul></ul><html> <head> ... </head> <body> ... </body> </html>
  8. 8. Tag Names Must Be in Lower Case <ul><li>This is because XHTML documents are XML applications </li></ul><ul><li>XML is case-sensitive </li></ul><ul><li>Tags like <br> and <BR> are interpreted as different tags </li></ul>
  9. 9. All XHTML Elements Must Be Closed <ul><li>Non-empty elements must have an end tag </li></ul><ul><li>Empty Elements Must also Be Closed </li></ul><ul><ul><li>Empty elements must either have an end tag or the start tag must end with /> </li></ul></ul>This is a break<br /> Here comes a horizontal rule:<hr /> Here's an image <img src=&quot;happy.gif&quot; alt=&quot;Happy face&quot; />
  10. 10. XHTML Syntax <ul><li>Writing XHTML demands a clean HTML syntax </li></ul><ul><li>Some more XHTML Syntax Rules: </li></ul><ul><ul><li>Attribute names must be in lower case </li></ul></ul><ul><ul><li>Attribute values must be quoted </li></ul></ul><ul><ul><li>Attribute minimization is forbidden </li></ul></ul><ul><ul><li>The id attribute replaces the name attribute </li></ul></ul><ul><ul><li>The XHTML DTD defines mandatory elements </li></ul></ul>
  11. 11. Attribute Minimization is Forbidden
  12. 12. The id Attribute replaces the Name Attribute <ul><li>HTML 4.01 defines a name attribute for the elements a, applet, frame, iframe, img, and map </li></ul><ul><li>In XHTML the name attribute is deprecated. Use id instead. </li></ul><ul><ul><li><img src=&quot;picture.gif&quot; id=&quot;picture1&quot; /> </li></ul></ul><ul><ul><li>To make your XHTML compatible with today's browsers, you should add an extra space before the &quot;/&quot; symbol </li></ul></ul>
  13. 13. Mandatory XHTML Elements <ul><li>All XHTML documents must have a DOCTYPE declaration </li></ul><ul><li>This is a minimum XHTML document template: </li></ul><?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;> <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;> <head> <title>... </title> </head> <body> ... </body> </html>
  14. 14. XHTML Document Type Definitions (DTD) <ul><li>The <!DOCTYPE> is Mandatory </li></ul><ul><li>The 3 Document Type Definitions </li></ul><ul><li>DTD specifies the syntax of a web page in SGML </li></ul><ul><li>An XHTML DTD describes in precise the allowed syntax and grammar of XHTML markup. </li></ul><ul><li>There are currently 3 XHTML 1.0 document types: </li></ul><ul><ul><li>STRICT </li></ul></ul><ul><ul><li>TRANSITIONAL </li></ul></ul><ul><ul><li>FRAMESET </li></ul></ul>
  15. 15. The 3 Document Type Definitions <ul><li>XHTML 1.0 Strict </li></ul><ul><ul><li>Use this when you want really clean markup, free of presentational clutter. Use this together with Cascading Style Sheets. </li></ul></ul><ul><li>XHTML 1.0 Transitional </li></ul><ul><ul><li>Use this when you need to take advantage of HTML's presentational features and when you want to support browsers that don't understand Cascading Style Sheets. </li></ul></ul><ul><li>XHTML 1.0 Frameset </li></ul><ul><ul><li>Use this when you want to use HTML Frames to partition the browser window into two or more frames. </li></ul></ul><!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>
  16. 16. XHTML Validation <ul><li>An XHTML document is validated against a Document Type Definition (DTD) </li></ul><ul><li>Test your XHTML with the W3C Validator </li></ul><ul><ul><li>http://validator.w3.org/ </li></ul></ul><ul><li>XHTML Tag List </li></ul><ul><ul><li>http://www.w3schools.comxhtmlxhtml_reference.asp </li></ul></ul><ul><li>XHTML Attributes </li></ul><ul><ul><li>http://www.w3schools.comxhtmlxhtml_standardattributes.asp </li></ul></ul>
  17. 17. W3C Recommendations <ul><li>XHTML 1.0 (Recommendation since January 2000) </li></ul><ul><ul><li>Three &quot;flavors&quot; of XHTML 1.0: </li></ul></ul><ul><ul><ul><li>XHTML 1.0 Strict </li></ul></ul></ul><ul><ul><ul><li>XHTML 1.0 Transitional </li></ul></ul></ul><ul><ul><ul><li>XHTML 1.0 Frameset The complete </li></ul></ul></ul><ul><li>XHTML Basic (Recommendation since December 2000) </li></ul><ul><ul><li>XHTML Basic is the second Recommendation in a series of XHTML specifications. </li></ul></ul><ul><ul><li>The XHTML Basic document type includes the minimal set of modules required to be an XHTML Host Language document type. </li></ul></ul><ul><ul><li>It includes images, forms, basic tables, and object support. </li></ul></ul><ul><ul><li>It is designed for Web clients that do not support the full set of XHTML features; such as mobile phones, PDAs, pagers, and settop boxes. </li></ul></ul>
  18. 18. … W3C Recommendations <ul><li>Modularization of XHTML (Recommendation since April 2001) </li></ul><ul><ul><li>Modularization of XHTML is the third Recommendation in a series of XHTML specifications. </li></ul></ul><ul><ul><li>This Recommendation specifies an abstract modularization of XHTML and an implementation of the abstraction using XML Document Type Definitions (DTDs). </li></ul></ul><ul><ul><li>This modularization provides a means for subsetting and extending XHTML, a feature needed for extending XHTML's reach onto emerging platforms. </li></ul></ul><ul><ul><li>Modularization of XHTML will make it easier to combine with markup tags for things like vector graphics, multimedia, math, electronic commerce and more. </li></ul></ul>
  19. 19. … W3C Recommendations <ul><li>XHTML 1.1 - Module-based XHTML (Recommendation since May 2001) </li></ul><ul><ul><li>While XHTML 1.1 looks very similar to XHTML 1.0 Strict, it is designed to serve as the basis for future extended XHTML Family document types, and its modular design makes it easier to add other modules as needed or integrate itself into other markup languages. </li></ul></ul><ul><li>XHTML 2.0 (first working draft – August 2002) </li></ul><ul><ul><li>XHTML 2.0 is a markup language intended for rich, portable web-based applications. While the ancestry of XHTML 2.0 comes from HTML 4, XHTML 1.0, and XHTML 1.1, it is not intended to be backward compatible with its earlier versions. </li></ul></ul>
  20. 20. Reading List <ul><li>W3Schools XHTML Tutorial </li></ul>