1 / 15

XHTML

Introduction. XHTML. Document Structure Overview. XML declaration (prolog) Document type declaration Root element (namespace) Document header Document body. Document Structure. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

roana
Download Presentation

XHTML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction XHTML

  2. Document Structure Overview • XML declaration (prolog) • Document type declaration • Root element (namespace) • Document header • Document body

  3. Document Structure <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Document Title</title> </head> <body> <p>Content of document...</p> </body> </html>

  4. XML Prolog • Optional • Specifies XML version • Declares type of character encoding • <?xml version=“1.0” encoding=“ISO-8859-1”?> • Problem: IE/Windows browser can not interpret prolog  site not displayed correctly • Solution: specify character encoding in <head> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /></head>

  5. Document Structure (for IE) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Document Title</title> </head> <body> <p>Content of document...</p> </body> </html>

  6. DOCTYPE and Namespace • Tell browsers how to interpret document • Tell validations services how to test for conformance

  7. DOCTYPE • Allows designers/developers to author several different types of documents, each bound by different rules • Rules: XHTML 1.0 specifications, called document type definition (DTD) • XHTML 1.0 offers 3 DTDs: • Transitional • Strict • Frameset

  8. DOCTYPE declaration • Top of every XHTML document, before any code or markup • After XML prolog • <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

  9. XHTML1 Transitional • Closest to HTML • Can work with • Presentational markup structures • Deprecated elements • Deprecated attributes • Used for converting existing web sites

  10. XHTML1 Frameset • Used for documents that contain a <frameset> element • Same elements as Transitional plus • Frameset • Frame • noframe

  11. XHTML1 Strict • Excludes all deprecated elements and attributes • New web site development • What we use in class

  12. Which Standard? • XHTML 1.0 Transitional • Conversion of existing HTML 4.01 sites • XHTML 1.0 Frames • Conversion of existing HTML 4.01 sites that contain frames • XHTML 1.0 Strict • New development • Use of style sheets • XHTML 1.1 • Currently lack of browser support • XHMTL 2.0 • Under development use in class

  13. Root Element (XML NameSpace) • Collection of XML element types and attribute names associated with a specific DTD • <html xmlns=http://www.w3.org/1999/xhtml xml:lang=“en” lang=“en”> Document in english Version of XML = english

  14. Document Header • Information about the document that is not considered part of the document content • Info for users • Info for browsers • Info for search engines • Must include title • Displayed in the top bar of the browser • Bookmark or favorites list • Key tool for accessibility • Search engines

  15. Document Body • <body>…</body> • Required element • Contains all elements of normal document flow

More Related