XHTML Basics I450 Technology Seminar Copyright 2003, Matt Hottell
HTML Developed in 1991 by Tim Berners-Lee in Switzerland for CERN
HTML Developed in 1991 by Tim Berners-Lee in Switzerland for CERN Originally designed for marking up and displaying scientific text
HTML Issues Browser war bloating
HTML Issues Browser war bloating Does not separate visual markup from logical markup
Logical markup Markup that explains what the tagged data is or what role it plays in the document
Logical markup Markup that explains what the tagged data is or what role it plays in the document
Visual markup Markup that only determines how the tagged data is to be displayed
Visual markup Markup that only determines how the tagged data is to be displayed
HTML My Page My favorite foods: Pizza Ice Cream Tortas My pictures:
Why XHTML? Separates logical from visual markup Move all visual markup into a separate style sheet Follows XML standards Is backwards-compatible with HTML Compatible with new types of displays Cell phones, kiosks, PDAs, etc.
XHTML Basics XHTML can be seen as a subset of logical HTML elements. 3 different XHTML subsets: Frameset, transitional, strict
XHTML Basics Must follow XML rules: Must be “well-formed” or syntactically correct according to a document standard For XHTML, this document standard is the World Wide Web Consortium XHTML standard which can be found at
XHTML Basics Must follow XML rules: All elements must be properly nested Bad: HI! Good: HI! Some elements can contain other elements, others cannot.
XHTML Basics Must follow XML rules: All tags must be properly terminated Bad: One Two Three Good: One Two Three becomes
XHTML Basics Must follow XML rules: All tags must be lower-case
XHTML Basics White space: Do not leave trailing spaces Separate attributes by one space Bad: Good:
XHTML Basics Attributes Must be enclosed in quotes Name attribute replaced by id No standalone attributes Images require alt attributes.
XHTML Basics Must validate against a document model that is declared at the beginning of the XHTML document
XHTML Skeleton Untitled Document
HTML My Page My favorite foods: Pizza Ice Cream Tortas My pictures:
XHTML Conversion Untitled Document My favorite foods: Pizza Ice Cream Tortas My pictures: