Setting Global Style
Can be placed in one global location inside the
Styling Background and Paragraph
for each tag, you can give properties
Structure of the Image Tag
An image tag specifies a file that contains an image:
src is the abbreviation for “source”
filename uses the same rules for absolute and relative pathnames as anchor tags
alt value specifies an alternative form for the image, usually a textual description
Structure of the Image Tag
The alt tag was introduced to assist persons who are visually impaired
Screen readers don’t know what the image is, but they can read the description of the alt tag
HTML requires alt tags
When an image is not available or loads slow, browsers display the alt information
Image File Types
the file name needs to use the correct file extension
.gif, .png, .jpeg and .jpg are frequently used extenstions
Attributes for Image Tags
The attributes width and height of the image tag can be used to specify the size of an image
The photo puffer.jpg will appear as 200 × 200 pixels, even if the actual size of the photo is 2000 × 2000
Specify only the width or the height of an image
Styling Position for Images
Images are inserted in the page at the point in the text where the tag is specified in the HTML, and the text lines up with the bottom of the image
Messy? Hard to read?
A better way to place images in text is to flow the text around them
Styling Position for Images
You can either position the image on the left with the text to its right, or vice versa
To make the text flow around the image, use the style attribute in the image tag with the value"float:left" or "float:right“
To display an image without any text around it, enclose it in paragraph tags
Add Extra Information
To benefit from the automatic checking service, you need to add three more lines to the starterPage.html
These lines are not required for the file to be a proper HTML page, but they are needed by the checking service
Before the tag, add the lines:
Go to www.w3.org/QA/2002/04/valid-dtd-list.html for exact format
Add Extra Information
The other line that we need to add is
between
Материалы на данной страницы взяты из открытых источников либо размещены пользователем в соответствии с договором-офертой сайта. Вы можете сообщить о нарушении.