📄 618-622.html
字号:
<HTML>
<HEAD>
<TITLE>Special Edition Using Linux, Fourth Edition:Creating Web Documents with HTML</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=0789717468//-->
<!--TITLE=Special Edition Using Linux, Fourth Edition//-->
<!--AUTHOR=Jack Tackett//-->
<!--AUTHOR=Jr.//-->
<!--AUTHOR=Steve Burnett//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Que//-->
<!--CHAPTER=32//-->
<!--PAGES=618-622//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="615-618.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="622-625.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
</P>
<P>Table 32.1 provides a quick listing of some of the most common HTML tags for text formatting.
</P>
<TABLE><CAPTION ALIGN=LEFT><B>Table 32.1</B> Selected HTML Text-Formatting Tags
<TR>
<TH COLSPAN="2"><HR>
<TR>
<TH WIDTH="40%" ALIGN="LEFT">Tag
<TH WIDTH="60%" ALIGN="LEFT">Action
<TR>
<TD COLSPAN="2"><HR>
<TR>
<TD><TT><B>…</B></TT>
<TD>Makes text <B>bold</B>.
<TR>
<TD><TT><BLOCKQUOTE>…</BLOCKQUOTE></TT>
<TD>Formats text with left and right indents.
<TR>
<TD VALIGN="TOP"><TT><FONT>…</FONT></TT>
<TD>Controls various aspects of text with attributes—for example, text color (<TT>COLOR=<I>rgb_value</I></TT>) and size (<TT>SIZE=<I>number</I></TT>).
<TR>
<TD><TT><I>…</I></TT>
<TD>Makes text <I>italic</I>.
<TR>
<TD><TT><PRE>…</PRE></TT>
<TD>Leaves text formatting exactly as it appears.
<TR>
<TD><TT><STRIKE>…</STRIKE></TT>
<TD>Formats text as <STRIKE>strikethrough</STRIKE>.
<TR>
<TD><TT><U>…</U></TT>
<TD><U>Underlines</U> text.
<TR>
<TD VALIGN="TOP"><TT><EM>…</EM></TT>
<TD>Logical style; emphasizes text (typically displayed as <I>italic</I>).
<TR>
<TD><TT><KBD>…</KBD></TT>
<TD>Logical style; shows text as a keyboard style (usually displayed in a <TT>monospaced</TT> font).
<TR>
<TD VALIGN="TOP"><TT><STRONG>…</STRONG></TT>
<TD>Logical style; emphasizes text (typically displayed as <B>bold</B>).
<TR>
<TD COLSPAN="2"><HR>
</TABLE>
<P><FONT SIZE="+1"><B>Miscellaneous Text</B></FONT></P>
<P>Two formatting tags that don’t fit in with other tag categories are the <TT><ADDRESS></TT> and <TT></ADDRESS></TT> tags. These tags are used to mark addresses, signatures, and so on within a document. Typically, text with this format is placed at the end of a document, following a horizontal rule mark. The exact formatting of <TT><ADDRESS></TT> text is determined by the individual Web browser.</P>
<H4 ALIGN="LEFT"><A NAME="Heading11"></A><FONT COLOR="#000077">Organizing Information with Lists</FONT></H4>
<P>Sometimes you need to deliver information that’s logically grouped in some fashion. For example, you might have a list of graphic images to display, or you might want to show a numbered top 10 list. HTML provides several different ways to format and display lists of information. Using lists in HTML is a powerful way to deliver information, because the user’s Web browser formats all the text in the list in a consistent manner. All you have to do is decide how the information fits together.
</P>
<P><FONT SIZE="+1"><B>Displaying Unordered Lists</B></FONT></P>
<P>An <I>unordered list</I> is text displayed separately with a bullet or other formatting character. Each text entry in an unordered list can be several lines long.</P>
<P>Two sets of tags are used to create an unordered list. The <TT><UL></TT> and <TT></UL></TT> tags define the beginning and end of the list, and the <TT><LI></TT> tag is used to mark each list item. Listing 32.4 shows the HTML source for a simple unordered list. Figure 32.5 shows how Mosaic displays this list.</P>
<P><B>Listing 32.4</B> An Unordered List</P>
<!-- CODE //-->
<PRE>
<HTML>
<HEAD>
<TITLE>An Unordered List</TITLE>
</HEAD>
<BODY>
<LI>This is list item 1.
<LI>This is list item 2.
<LI>This is list item 3.
</UL>
</BODY>
</HTML>
</PRE>
<!-- END CODE //-->
<P><A NAME="Fig5"></A><A HREF="javascript:displayWindow('images/32-05.jpg',447,298 )"><IMG SRC="images/32-05t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/32-05.jpg',447,298)"><FONT COLOR="#000077"><B>FIG. 32.5</B></FONT></A> An unordered list displayed in Mosaic.</P>
<P><FONT SIZE="+1"><B>Presenting Ordered Lists</B></FONT></P>
<P>An <I>ordered list</I> presents list information in numerical order. Each time a new list item is identified, the number of the list item is incremented. Ordered lists are defined by the <TT><OL></TT> and <TT></OL></TT> tags, and the same <TT><LI></TT> tag used in unordered lists is also used in ordered lists to mark each list item.</P>
<P>Listing 32.5 shows the HTML source for a simple ordered list. Figure 32.6 shows how this list is displayed in Mosaic.</P>
<P><B>Listing 32.5</B> An Ordered List</P>
<!-- CODE //-->
<PRE>
<HTML>
<HEAD>
<TITLE>An Ordered List</TITLE>
</HEAD>
<BODY>
<OL>
<LI>This is list item 1.
<LI>This is list item 2.
<LI>This is list item 3.
</OL>
</BODY>
</HTML>
</PRE>
<!-- END CODE //-->
<P><A NAME="Fig6"></A><A HREF="javascript:displayWindow('images/32-06.jpg',447,297 )"><IMG SRC="images/32-06t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/32-06.jpg',447,297)"><FONT COLOR="#000077"><B>FIG. 32.6</B></FONT></A> An unordered list displayed in Mosaic.</P>
<P><FONT SIZE="+1"><B>Using Definition Lists</B></FONT></P>
<P>Think of how a glossary in a book looks: You typically have each word or term offset by itself and then a paragraph giving its definition. HTML definition (or glossary) lists provide a way to do this with Web pages. A definition list consists of a term—this can be one word or a series of words—followed by a definition. The definition is usually explanatory text.
</P>
<P>Although definition lists are particularly useful for glossaries, you can use them to present any kind of information where you need a title and an explanation. One common use is to make the glossary term a hypertext link to another document and make the definition a description of the linked document. (Creating hypertext links is discussed later in this chapter, so keep this application of a definition list in mind.)</P>
<P>Definition lists require the <TT><DL></TT> and <TT></DL></TT> tags to mark the start and end of the list. Rather than use a simple list item tag, definition lists use dual tags: <TT><DT></TT> to mark the glossary item and <TT><DD></TT> to mark the definition. Listing 32.6 shows the HTML source for a simple definition list. Figure 32.7 shows how this list is displayed in Mosaic.</P>
<P><B>Listing 32.6</B> A Simple Definition List</P>
<!-- CODE //-->
<PRE>
<HTML>
<HEAD>
<TITLE>A Simple Glossary List</TITLE>
</HEAD>
<BODY>
<DL>
<DT>Item 1
<DD>This is the definition field for list item 1.
<DT>Item 2
<DD>This is the definition field for list item 2.
<DT>Item 3
<DD>This is the definition field for list item 3.
</DL>
</BODY>
</HTML>
</PRE>
<!-- END CODE //-->
<P><A NAME="Fig7"></A><A HREF="javascript:displayWindow('images/32-07.jpg',641,437 )"><IMG SRC="images/32-07t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/32-07.jpg',641,437)"><FONT COLOR="#000077"><B>FIG. 32.7</B></FONT></A> A simple definition list displayed in Mosaic.<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="615-618.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="622-625.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -