Summary


Tags, tags, and more tags! Today you learned about most of the remaining tags in the HTML language for presenting text, and quite a few of the tags for additional text formatting and presentation. You also put together a real-life HTML home page. You could stop now and create quite presentable web pages, but more cool stuff is to come. So, don't put down the book yet.

Table 6.2 presents a quick summary of all the tags and attributes you've learned about today that are included in the HTML 4.01 specification. Table 6.3 summarizes the CSS properties that have been described in today's discussion.

Table 6.2. HTML Tags from Lesson 6

Tag

Attribute

Use

<address>...</address>

 

A signature for each web page; typically occurs near the bottom of each document and contains contact or copyright information.

<b>...</b>

 

Bold text.

<big>...</big>

 

Text in a larger font than the text around it.

<blink>...</blink>

 

Causes the enclosed text to blink (Netscape only).

<blockquote>...</blockquote>

 

A quotation longer than a few words.

<cite>...</cite>

 

A citation.

<code>...</code>

 

A code sample.

<dfn>...</dfn>

 

A definition, or a term about to be defined.

<em>...</em>

 

Emphasized text.

<i>...</i>

 

Italic text.

<kbd>...</kbd>

 

Text to be typed in by the user.

<pre>...</pre>

 

Preformatted text; all spaces, tabs, and returns are retained. Text is printed in a monospaced font.

<s>...</s>

 

Strikethrough text. (Deprecated in HTML 4.01.)

<samp>...</samp>

 

Sample text.

<small>...</small>

 

Text in a smaller font than the text around it.

<strong>...</strong>

 

Strongly emphasized text.

<sub>...</sub>

 

Subscript text.

<sup>...</sup>

 

Superscript text.

<tt>...</tt>

 

Text in typewriter font (a monospaced font such as Courier).

<u>...</u>

 

Underlined text.

<var>...</var>

 

A variable name.

<span>...</span>

 

A generic tag used to apply styles to a particular bit of text.

<hr>

 

A horizontal rule line at the given position in the text. There's no closing tag in HTML for <hr>; for XHTML, add a space and forward slash ( /) at the end of the tag and its attributes (for example, <hr size="2" width="75%" />).

 

size

The thickness of the rule, in pixels. (Deprecated in HTML 4.01.)

 

width

The width of the rule, either in exact pixels or as a percentage of page width (for example, 50%). (Deprecated in HTML 4.01.)

 

align

The alignment of the rule on the page. Possible values are left, right, and center. (Deprecated in HTML 4.01.)

 

noshade

Displays the rule without three-dimensional shading. (Deprecated in HTML 4.01.)

<br>

 

A line break; starts the next character on the next line, but doesn't create a new paragraph or list item. There's no closing tag in HTML for <br>; for XHTML, add a space and forward slash ( /) at the end of the tag and its attributes (for example, <br clear="left" />).

<nobr>...</nobr>

 

Doesn't wrap the enclosed text (nonstandard; supported by Netscape and Internet Explorer).

<wbr>

 

Wraps the text at this point only if necessary (nonstandard; supported by Netscape and Internet Explorer). Adds a space and forward slash at the end of the tag for XHTML 1.0.

<p>...</p>, <h1-6>...</h1-6>

align="left"

Left-justifies the text within that paragraph or heading. (Deprecated in HTML 4.01.)

 

align="right"

Right-justifies the text within that paragraph or heading. (Deprecated in HTML 4.01.)

 

align="center"

Centers the text within that paragraph or heading. (Deprecated in HTML 4.01.)

<div>...</div>

align="left"

Left-justifies all the content between the opening and closing tags. (Deprecated in HTML 4.01.)

 

align="right"

Right-justifies all the content between the opening and closing tags. (Deprecated in HTML 4.01.)

 

align="center"

Centers all the content between the opening and closing tags. (Deprecated in HTML 4.01.)

<center>...</center>

 

Centers all the content between the opening and closing tags. (Deprecated in HTML 4.01.)

<font>...</font>

size

The size of the font to change to, either from 1 to 7 (default is 3) or as a relative number using +N or -N. Relative font sizes are based on the value of <basefont>. (Deprecated in HTML 4.01.)

 

face

The name of the font to change to, as a list of fonts to choose from. (Deprecated in HTML 4.01.)

<basefont>

size

The default font size on which relative font size changes are based. (Deprecated in HTML 4.01.) There is no closing tag in HTML for <basefont>; for XHTML, add a space and forward slash ( /) at the end of the tag and its attributes (for example, <basefont size="-1" />).


Table 6.3. CSS Properties from Lesson 6

Property

Use/Values

text-decoration

Specifies which sort of decoration should be applied to the text. The values are underline, overline, line-through, blink, and none.

font-style

Specifies whether text should be italicized. The three values are normal, italic, and oblique.

font-weight

Specifies the degree to which text should be emboldened. Options are normal, bold, bolder, lighter, and 100 - 900.

font-family

Enables you to specify the font used for text. You can choose families such as serif, sans serif, and monospace, or specific font names. You can specify more than one font or font family as well.

font-variant

Sets the font variant to normal or small-caps.

text-align

Specifies how text is aligned: left, right, center, or justify.

font-size

Enables you to specify the font size in any unit supported by CSS.





Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day
Sams Teach Yourself Web Publishing with HTML and CSS in One Hour a Day (5th Edition)
ISBN: 0672328860
EAN: 2147483647
Year: 2007
Pages: 305

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net