Table 273: Common Hypertext Markup Language (HTML) Elements
Element
|
Example
Element and Tags
|
Description
|
Paragraph
|
<p>Jack and Jill went
up the hill to fetch a
pail of water
</p>
|
Delineates a paragraph of text.
Note that everything between the start and end tags will be considered
one paragraph, even if split onto multiple lines as I have done here;
line breaks are not significant in HTML formatting, only tags.
|
Line
Break
|
George W. Bush<br>
The White House<br>
1600 Pennsylvania Ave., NW<br>
Washington, DC 20500
|
Forces a line
break. Used instead of the paragraph tag to present lines close together,
such as addresses.
|
Heading
|
<h1>First Topic</h1>
<h2>Subtopic</h2>
|
Defines section headings, to
allow information in a long document to be displayed in hierarchical
form. Six sets of tags are defined, from <h1> and </h1>
to <h6> and </h6>. Browsers will automatically display the
higher-level headings in more prominent ways, by using larger
fonts, underlining the text, or similar.
|
List
|
<p>Shopping
list:
<ul>
<li>Milk
<li>Eggs
<li>Sushi
</ul>
</p>
|
Allows information
to be presented as a list. The tag <ul> means unnumbered
list and causes the list items to be shown usually as bullet points.
Alternately, <ol> (ordered list) can be
used to show the items preceded by 1, 2, 3 and so on.
|
Horizontal Rule
|
end of this part of the
story.</p>
<hr size= 3>
<p>Start of next part of story
|
Draws a horizontal line across
the page; the size parameter controls its thickness. Used
to separate logical sections in a document.
|
Image
|
<img src=companylogo.gif
alt=XYZ Industries Logo align=center>
|
Displays an
inline image in the appropriate section of the text. The src
parameter is a relative or absolute URL for the image, and numerous
other parameters can be included to define the image's alignment, size,
alternate text to display if the browser is non-graphical
(as shown here with the alt parameter) and much more.
|
Link
|
<a href=&t_.htmhttp://www.PCGuide.com>Click
here to visit The PC Guide</a>
|
Hyperlinks to another document.
The a in the tag stands for anchor, which is
the formal name for a hyperlink. the href parameter specifies
the URL of the link.
Most browsers will underline or otherwise highlight the text between
the start and end tags to make it clear that the text represents a hyperlink.
It is also possible to give a hyperlink to an image by combining the
<img> and <a> tags.
|
Bookmark
|
<a name=Step4>Step
4: Remove paint using scrubbing tool.</a>
|
Creates a bookmark
that can be used to hyperlink to a particular section in a document.
For example, if the bookmark in this example was in a document at URL
http://www.homefixitup.com/repainting.htm, the URL http://www.homefixitup.com/repainting.htm#Step4
refers to this particular place in the document. See
the next topic on URLs for more details.
|
Table
|
<table>
<tr>
<td>1st row, 1st column.</td>
<td>1st row, 2nd column.</td>
</tr>
<tr>
<td>2nd row, 1st column.</td>
<td>2nd row, 2nd column.</td>
</tr>
</table>
|
Displays information in tabular
form. Each <tr> and </tr> tag set
defines one row of the table; within each row, each <td>
and </td> pair defines one table data element. Many
different parameters can be provided for each of these tags to control
table size and appearance.
|
Form
|
<form method="POST"
action="https://www.myfavesite.com/order.php">
<input type="hidden" name="PRODUCT" value="widget">
<input type=text name=QUANTITY size="3">
<input type="submit" value="Click Here to Proceed to the Secure Processing
Site">
</form>
|
Defines an
HTML form, allowing various sorts of information to be submitted by
a client to a program on a Web site designed to process forms. The form
consists of the initial <form> tag that describes
what action to be taken when the submission button is pressed, and other
form items such as predefined variables, text entry fields, and buttons;
one example of each of these items is shown here.
|
Script
|
<script language=javascript>
(Javascript code)
</script>
|
Allows instructions in a scripting
language to be included in an HTML document. Most often used for Javascript.
|