Presentation is loading. Please wait.

Presentation is loading. Please wait.

XHTML Instructor: Charles Moen CSCI/CINF 4230. 2 XHTML  A stricter version of HTML  Extensible HTML  The XHTML specification is maintained by the World.

Similar presentations


Presentation on theme: "XHTML Instructor: Charles Moen CSCI/CINF 4230. 2 XHTML  A stricter version of HTML  Extensible HTML  The XHTML specification is maintained by the World."— Presentation transcript:

1 XHTML Instructor: Charles Moen CSCI/CINF 4230

2 2 XHTML  A stricter version of HTML  Extensible HTML  The XHTML specification is maintained by the World Wide Web Consortium (W3C)‏  Current version is 1.1, but browsers support only XHTML 1.0  HTML 4.01 with stricter syntax rules XHTML (W3Schools, Schultz, Wikipedia)‏

3 3 XHTML Syntax Rules  All tag names and attribute names must be lower case  Elements must always be closed  Elements must be properly nested  All attribute values must be surrounded with quotes  All attributes must have a value  The DOCTYPE is required  Some elements are mandatory  Some elements are deprecated XHTML (W3Schools, Schultz)‏

4 4 Why XHTML?  With HTML, browsers were programmed to overlook “coding errors,” such as improper nesting Required more browser resources Web developers were often unaware of errors because they were masked by the browser  Benefits of more consistent syntax rules Reduce the demands on user agents Well-formed code that is more compatible Code is displayed more consistently by all browsers XHTML (W3Schools, Wikipedia, W3C)‏

5 5 HTML vs. XHTML Both of these pages display the same content XHTML Old HTML Thursday Specials Double coupons today! Vegetables Green beans Broccoli Spinach Fruit <!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"> An XHTML Page <meta http-equiv="content-type" content="text/html;charset=utf-8" /> Thursday Specials Double coupons today! Vegetables Green beans Broccoli Spinach Fruit Valid HTML Valid XHTML

6 6 Three Types For your homework, use the “strict” XHTML 1.0 DOCTYPE, unless your page uses frames (see below) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> XHTML (W3Schools, Schultz, W3C)‏ For your homework pages that use frames, use the “frameset” XHTML 1.0 DOCTYPE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> More relaxed, allowing some deprecated features: “transitional” XHTML 1.0 DOCTYPE <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

7 7 Markup Validation  A markup validator checks whether your markup code follows the standards; it checks the following: Only allowed elements are used Tag names are spelled correctly Opening and closing tags are matched No grammar rules are violated  W3C Markup Validation Service http://validator.w3.org XHTML (W3C)‏ All homework assignments for this course must be validated, using the W3C Markup Validator, and they must have a W3C validator link on the page

8 8 References Ding, Wei, “XHTML” UHCL lecture slides, 2008. Schultz, David and Craig Cook, Beginning HTML with CSS and XHTML: Modern Guide and Reference. Apress, 2007. W3C. (2007). “Recommended list of DTDs”, [Online]. Available: http://www.w3.org/QA/2002/04/valid-dtd-list.html W3Schools Online Web Tutorials. "Learn XHTML". [Online]. Available: http://www.w3schools.com/xhtml/default.asp Wikipedia. “XHTML”. [Online]. Available:http://en.wikipedia.org/wiki/XHTML


Download ppt "XHTML Instructor: Charles Moen CSCI/CINF 4230. 2 XHTML  A stricter version of HTML  Extensible HTML  The XHTML specification is maintained by the World."

Similar presentations


Ads by Google