XML - Managing Data Exchange/XHTML/Exercises

From Wikibooks, open books for an open world
Jump to navigation Jump to search

XHTML Chapter => XHTML

XHTML Answers => Answers

Exercise 1[edit]

Below 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.

      Convert HTML to XHTML
  <body text=blue>
        XHTML page
    <p><b> It is important for your site to be current with the most recent W3C standards.
       <u>Welcome</u> to my <b>page</b>.<br>
       I hope that you <i>enjoy</i> your stay.
      <font color=#9900FF face=Arial size=+2>
       XHTML is similar to HTML
    <a href=http://validator.w3.org/>

Exercise 2[edit]

Create 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