Images

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

RGB colors

-Colorsare combined using their red, green, and bluevalues -This is called RGB -The values range from 0 to 255 -The values/intensity of red, green, and blue -rgb(0, 0, 0) is black -rgb(255, 255, 255) is white

Images in Another Folder

If you have your images in a sub-folder, you must include the folder name in the src attribute: Example <img src="/images/html5.gif" alt="HTML5 Icon" style="width:128px;height:128px;">

The alt Attribute

The required alt attribute provides an alternate text for an image, if the user for some reason cannot view it (because of slow connection, an error in the src attribute, or if the user uses a screen reader). The value of the alt attribute should describe the image: Note: If a browser cannot find an image, it will display the value of the alt attribute:

The src Attribute

The required src attribute specifies the path (URL) to the image.

HTML Images Syntax

The HTML <img> tag is used to embed an image in a web page. Images are not technically inserted into a web page; images are linked to web pages. The <img> tag creates a holding space for the referenced image. The <img> tag is empty, it contains attributes only, and does not have a closing tag. The <img> tag has two required attributes: src - Specifies the path to the image alt - Specifies an alternate text for the image Syntax <img src="url" alt="alternatetext">

Image as a Link

To use an image as a link, put the <img> tag inside the <a> tag: Example <a href="default.asp"> <img src="smiley.gif" alt="HTML tutorial" style="width:42px;height:42px;"></a>

Image Floating

Use the CSS float property to let the image float to the right or to the left of a text: Example <p><img src="smiley.gif" alt="Smiley face" style="float:right;width:42px;height:42px;">The image will float to the right of the text.</p><p><img src="smiley.gif" alt="Smiley face" style="float:left;width:42px;height:42px;">The image will float to the left of the text.</p>

Chapter Summary

Use the HTML <img> element to define an image Use the HTML src attribute to define the URL of the image Use the HTML alt attribute to define an alternate text for an image, if it cannot be displayed Use the HTML width and height attributes or the CSS width and height properties to define the size of the image Use the CSS float property to let the image float to the left or to the right


Ensembles d'études connexes

Prevention questions for CH final

View Set

Weather and Climate Lecture 3: Climatology and Meteorology

View Set

20,8,26 17,1,10,23,7,10 3,13,3,10 8,24,23,13

View Set