HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 2. CONTENT VS MARKUP 21


andnotlikewidth=500px(where px is the CSS abbreviation for pixels).


height= It is helpful to specify the size of the image. This can be done
using the height= attribute. Height are measured in pixels. If you specify
height but no width, the browser will calculate the width for you.


If you specify both the width and the height, you can distort the image.


(We can also use CSS to specify max width, min width, max height, and
min height, depending on what we are trying to achieve.)


alt= The img tag has a required attribute: alt= is used to provide a
description of the image. This is primarily for disabled web users who might
not be able to see the image, and must have a web reader say aloud the words
you put in the alt= attribute.


Normally the alt text includes spaces. If so, the text must be surrounded
by quote marks. If it is just one simple word, the quotes can be left off.


title= All tags have this optional attribute: title= is used to provide
additional information that is only visible when the user hovers their mouse
over the item. (It is not clear to me how you hover a mouse on a mobile
device like a smart phone or tablet.)


Normally the title text includes spaces. If so, the text must be surrounded
by quote marks.


2.2.6 a: Link


Exam Question 22(p.337):The HTML tag “a” stands for what word(s)?
Acceptable Answer:anchor


The a tag uses an href parameter to specify the destination your user will
go to when they click on the link.


The a tag uses a target parameter to specify the destination is to be opened
in a new tab in the browser.


Example:Click Here


The content betweenandis the clickable link. Other things can
be placed there, such as images.


Havingat the end is required.

Free download pdf