XML - Managing Data Exchange/XHTML/Exercises
XHTML Chapter => XHTML
XHTML Answers => Answers
Exercise 1
editBelow is an example of an invalid HTML document that contains a number of deprecated features. It is also badly structured. The document needs converting to XHTML with the content separated from the presentation.
a. Change the HTML document into a valid XHTML 1.0 Transitional document. Validate your page using the validator available at http://validator.w3.org/.
b. Starting with the model answer for question 1.a. indentify all deprecated elements and attributes in the document and replace them with CSS in a linked external stylesheet. See HyperText Markup Language/Tag List for details of deprecated elements.
c. Starting with the model answer for question 1.b. replace all presentational markup with semantic markup and ensure that all inline elements are contained in block-level elements. Change the DOCTYPE to XHTML 1.0 Strict and validate the page with the W3C Markup Validation Service.
<html> <head> <title> Convert HTML to XHTML </head> <body text=blue> <h1> XHTML page </h1> <p><b> It is important for your site to be current with the most recent W3C standards. </p></b> <u>Welcome</u> to my <b>page</b>.<br> I hope that you <i>enjoy</i> your stay. <p> <font color=#9900FF face=Arial size=+2> XHTML is similar to HTML </font> </p> <a href=http://validator.w3.org/> Validator </a> </body> </html>
Exercise 2
editCreate a simple HTML document and purposely nest tags incorrectly or don't close a few tags, then run the document through the W3C's online HTML Tidy service.
XHTML Chapter => XHTML
XHTML Answers => Answers