Lesson 5

14
Lesson 5

description

Lesson 5. XHTML Tags , Attributes and Structure. XHTML Basic Structure head and body titles Paragraph headings comments Document Presentation Manipulating Text Font Font Style Images Horizontal Rule Lists Unordered Lists Ordered Lists. Tags. - PowerPoint PPT Presentation

Transcript of Lesson 5

Page 1: Lesson 5

Lesson 5

Page 2: Lesson 5

XHTML Tags , Attributes and Structure

XHTML Basic Structure• head and body• titles• Paragraph• headings• comments

Document Presentation• Manipulating Text• Font• Font Style• Images• Horizontal Rule

Lists• Unordered Lists• Ordered Lists

Page 3: Lesson 5

Tags

The <html> tag identifies a document as an HTML document.

All HTML documents must start with the </html> tag and end with the </html> tag.

An xmlns - XML namespace - is also included as part of the html tag. The namespace declaration is considered to apply to the element where it is specified and to all elements within the content of that element.

Using <html xmlns="http://www.w3.org/1999/xhtml"> will apply the XHTML namespace to all elements within the HTML document.

Page 4: Lesson 5

Text Formatting

Note that in HTML we have:

• Logical Tags

• Physical Tags

• Alignment and misc. tags

Logical Tags are used to format text without specifying the exact appearance of the text. The exact appearance of the text is left to the browsers to define. Examples are the <em> emphasis</em and the <strong>strong</strong> tags.

Physical Tags specify the exact appearance of text. The challenge here is to know which browsers support which tags vs. the desire by web designers to have more control on text formatting.

Alignment and misc tags are specifically used to give the desired alignment and to display special characters or text.

Page 5: Lesson 5

Text effects

• <b></b>• <i></i>• <em></em> preferred to <i>• <strong></strong> preferred to <b>Why? some people listen to web pages or read them in

braille, while others use a browser that can not display bold or italic.

Note:• <u></u>

– Don’t use since it looks like a hyperlink

Page 6: Lesson 5

HTML has the instructions (tags, speciali characters, etc) and tries to make web pages complaint with current and older Browsers

XHTML

Uses stylesheets but older browsers don't understand stylesheets

Page 7: Lesson 5

Other special characters include the:

• <sub> subscript

• <sup> superscript

• &frac14

Here text is <B>bold!</B>   Here text is <U>underlined</U>Here text is <I>italicized.</I>

Here text is bold!Here text is underlinedHere text is italicized

Five is &lt; 15   And 18 is &gt; 8All &copy;IBM software is goodAnd this is the &amp sign

5 is < 15And 18 is > 8All ©IBM software is goodand this is the & sign

Page 8: Lesson 5

Changing fonts:

<font face=“fontname1, fontname2”>write text here</font>

Font is a deprecated tag. Stylesheets

Font Style Stylesheets

Need to remove Document Presentation from Document Structure

Page 9: Lesson 5

Unordered Lists

• Unordered Lists– Are lists without any order and are rendered with a line break and a bullet

symbol

For solid bullets use For hollow bullets useFor hollow squares use

<ul type=“disc”><ul type=“circle”><ul type=“square”>

Page 10: Lesson 5

Ordered and Nested Lists

• Ordered Lists• Nested Lists

To use Arabic numerals To use Capital lettersTo use lowercase lettersTo use Capital Roman numeralsTo use lowercase Roman numerals

<ol type=“1”><ol type=“A”><ol type=“a”><ol type=“I”><ol type=“i”>

Page 11: Lesson 5

Review

True/FalseEvery XHTML document contains a start <HTML> tag and an end </HTML>

True

Web browsers typically underline text hyperlinks and color them grey by default

False

The color is blue

Page 12: Lesson 5

Review

True/FalseEvery img element in a valid XHTML document must have an alt attribute

True

The img element is an example of an empty element

True

Page 13: Lesson 5

Review

True/FalseThe hr element inserts a line break above and below the horizontal line

True

Unordered list element ul creates a list in which each item in the list begins with a square symbol

False

A bullet symbol unless otherwise specified

Page 14: Lesson 5

Review

True/False

XHTML provides special characters in the form &code; for representing characters that cannot be marked up.

True

The <blockquote> works almost identical to the <p> except the whole paragraph will be indented one tab - 3 spaces.

False

5 spaces