Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson 4.

Similar presentations


Presentation on theme: "Lesson 4."— Presentation transcript:

1 Lesson 4

2 An XHTML document consists of three main parts:
The DOCTYPE; The Head The Body.

3 Strict <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
" Strict: Strict follows the most stringent rules of XHTML. Only current elements, attributes, and character entities are allowed in documents written in this type. Elements such as font or center, that were deprecated in HTML 4.0, are not allowed. Obsolete elements are also not allowed. In summary it defines the DTD that we are using. Use this when you want really clean markup, free of presentational clutter. Use this together with Cascading Style Sheets.

4 Transitional <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " Transitional: A transitional XHTML 1.0 document is more lenient, allowing the author to use deprecated as well as current methods. You can use font or center, or any other deprecated markup in a transitional document -- so long as the document itself is properly marked as such. No obsolete elements should be used. Use this when you need to take advantage of HTML's presentational features because many of your readers don't have the latest browsers that understand Cascading Style Sheets.

5 Frameset <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
" Frameset: The frameset DTD is reserved only for frameset documents. A frameset document conforming to this DTD can use either strict or transitional markup. Use this when you want to use HTML Frames to partition the browser window into two or more frames. To check that you have written a valid XHTML document with a correct DTD,  you can link your XHTML page to a validator. xmlns Declares in the <html> tag the XHTML name space and language attributes.

6 All XHTML documents must have a DOCTYPE declaration. The html,
head and body elements must be present, and the title must be present inside the head element. This is a minimum XHTML document template: <!DOCTYPE Doctype goes here> <html> <head> <title>Title goes here</title> </head> <body> Body text goes here </body> </html> Note: The DOCTYPE declaration is not a part of the XHTML document itself. It is not an XHTML element, and it should not have a closing tag.

7 Here are the main things to remember when writing XHTML:
Must have a DOCTYPE declaration All XHTML tags are lower case Close all tags (even empty elements) Attribute values must be quoted Minimization is forbidden The id attribute replaces the name attribute Documents must conform to XML rules

8 Review True / False All XHTML documents must have a DOCTYPE declaration. The document must include the usual html, head, title, and body elements. TRUE Example of DOCTYPE: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

9 Review What is wrong with this
<A HREF="xhtml/xhtml_tutorial.html" TARGET="_BLANK"> XHTML Tutorial</A> All XHTML tags are lower case Right <a href="xhtml/xhtml_tutorial.html" target="_blank"> XHTML Tutorial</a>

10 Review <b><i> This text is bold and italic</b> </i> Documents must conform to XML rules <b><i> This text is bold and italic</i></b>

11 What is wrong with this <img src=“pict/xhtml_lesson.gif"> Close all tags (even empty elements) <img src="pict/xhtml_lesson.gif" />

12 Review What is wrong with this
<img src="pict/xhtml_lesson.gif" width=250 height=50 border=0 /> Attribute values must be quoted <img src="pict/xhtml_lesson.gif" width="250" height="50" border="0" />

13 Review <option selected> Minimization is forbidden
<option selected="selected">

14 Review <img src="pict/xhtml_lesson.gif" name="xhtml_lesson">
The id attribute replaces the name attribute <img src="pict/xhtml_lesson.gif" id="xhtml_lesson">


Download ppt "Lesson 4."

Similar presentations


Ads by Google