General
Computing
Concepts
Presentations Spreadsheets Web Design Word
Processing
Appendices

Study Guide: Web Design - Tag Attributes

<<Previous Next>>

Many HTML tags may have one or more attributes. Attributes are other parts of an HTML tag that describe options or other information about the tag itself. Attributes are put inside the < > brackets and after the tag name.

For example, the horizontal line, <HR>, tag can have 4 different attributes, size, align, width, and noshade.

The size attribute controls the thickness or height of the line:

<HR size="2">

<HR size="4">

<HR size="8">

The width attribute controls how long the line is. The width can be a number of pixels or a percentage of the browser window's width.

<HR width="80%">

<HR width="40%">

<HR width="200">

.

The align attribute controls where on the page the line is drawn. You might want a line centered on the page, or aligned on the right side.

<HR width="200" align="center">

<HR width="200" align="right">

The horizontal rule normally appears as a shadowed line which gives it a three dimensional look. If you'd like a plain line, without the shading, you can add the noshade attribute.

<HR noshade>

.

Exercise: Add some horizontal rules to your page. Use several attributes at once, for example:

<HR size="2" width="80%" align="center">

<HR size="4" width="40%" align="center">

View your changes in the browser.

 

Tek.XamReturn to Home