|
Image Elements
Adding images to a web page requires the use of the image <IMG> tag. The IMG tag, like a few other tags, can accept tag attributes. Attributes are small instructions added within the tag to modify its behavior or appearance.
NOTE:
The <IMG> tag is a example of a stand-alone tag; that is, there is no closing or end tag. The <IMG> tag requires the SRC attribute, which identifies the source of the image file. The source of the image can be either a file pathname or a URL.
Image size is expressed in pixels, which is a single point in an image. Using the WIDTH and HEIGHT attributes can speed up the display of a web page.
Horizontal Rule
- <HR>
- Example: <HR>
Example: <HR WIDTH="50%" SIZE="6">
Below is what a horizontal rule looks like within a web page
Inline Images
- <IMG>
- Example: <IMG SRC="picture.jpg">
Example: <IMG SRC="picture.jpg" WIDTH="200"
HEIGHT="300">
Here's a sample web page with some text and a single inline image. View the source to look at the HTML code used to generate the page.
Common <IMG> attributes:
- BORDER=number
- border thickness around the image, in pixels
-
- ALIGN=location [top, middle, or bottom]
- Vertical alignment of the image relative to the neighboring text line
-
|