HTML Basics[2]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:



</BODY>
</HTML>

Numbered List
To create a numbered list of items, use the <OL> tag. In between the <OL>
and </OL> tags, use the <LI> and </LI> tags to create each individual list
item. The <LI> tag automatically adds a line break after each item. Listing
5.3 includes an example of this technique.

To try out this sample page, which includes an ordered list, locate
OrderedList.htm in the InternetBasics folder:

Listing 5.3 Contents of OrderedList.htm
<HTML>
<BODY>
<H3>Ordered list</H3>

<OL>
<LI>Wash the car</LI>
<LI>Feed the cats</LI>
<LI>Take a nap</LI>
</OL>

</BODY>
</HTML>

Combo and List Boxes
To create a drop-down list or list box containing list items, use the
<SELECT> tag. The element supports a size attribute that allows you to
control the behavior of the control. If you set the size attribute to 1,
you'll get a drop-down (combo box) control. If you set it to a larger
value, you'll get a list box control.

Each list item in a SELECT element can contain both text, which displays in
the control itself, and a text value associated with that list item.
Listing 5.4 shows an example of this. When you're programmatically
interacting with these elements, later in the book, you'll use the values.

To try out this page, load Select.htm in the InternetBasics folder.

Listing 5.4 Contents of Select.htm
<HTML>
<BODY>
<H3>Select</H3>

<SELECT size=1>
<OPTION value="AZ">Arizona</OPTION>
<OPTION value="CA">California</OPTION>
<OPTION value="NV">Nevada</OPTION>
<OPTION value="TX">Texas</OPTION>
</SELECT>

<SELECT size=4>
<OPTION value="AZ">Arizona</OPTION>
<OPTION value="CA">California</OPTION>
<OPTION value="NV">Nevada</OPTION>
<OPTION value="TX">Texas</OPTION>
</SELECT>

</BODY>
</HTML>

Table
If you wish to create a grid containing items, use the <TABLE> tag. Within
the <TABLE> and </TABLE> tags, use a combination of <TR>, <TH>, and <TD>
tags to create each row, header, and detail cell for the table. Listing 5.5
shows an example of this.

The following page, Table.htm, demonstrates the use of a table, with rows,
cells, and headers:

Listing 5.5 Contents of Table.htm
<HTML>
<BODY>
<H3>Table</H3>

<TABLE Border=1>
<TR>
  <TH>Abbr</TH>
  <TH>State</TH>
</TR>
<TR>
  <TD>AZ</TD>
  <TD>Arizona</TD>
</TR>
<TR>
  <TD>CA</TD>
  <TD>California</TD>
</TR>
<TR>
  <TD>NV</TD>
  <TD>Nevada</TD>
</TR>
</TABLE>

</BODY>
</HTML>

Images
To display an image within a Web page, use the <IMG> tag. You must supply
the src="FileName" attribute in order to specify the name of the file that
contains the picture you wish to display. Table 5.1 contains a list of the
different types of files Internet Explorer 5 and later can display.

Table 5.1. Image Types Supported by Internet Explorer File Extension 
Description 
.avi  Audio/Visual Interleaved (AVI) 
.bmp  Windows Bitmap (BMP) 
.emf  Windows Enhanced Metafile (EMF) 
.gif  Graphics Interchange Format (GIF) 
.jpg, .jpeg  Joint Photographic Experts Group (JPEG) 
.mov  Apple QuickTime Movie (MOV) 
.mpg, .mpeg  Motion Picture Experts Group (MPEG) 
.png  Portable Network Graphics (PNG) 
.wmf  Windows Metafile (WMF) 
.xbm  X Bitmap (XBM) 


NOTE

Your browser might not support all the different image types listed in
Table 5.1.



To try out using an image, load the following page, Image.htm:

<HTML>
<BODY>
<H3>Pictures</H3>

<img src="Northwind.gif">

</BODY>
</HTML>

Input Types
You'll need some way to allow users to input data onto your page. You can
do this using the <INPUT> tag. You can add several attributes to this tag
to control the type of input control you get on the page, as listed in

本文关键:HTML Basics
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top