HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 1. FIRST WEBPAGE 10


underline content.



is the line break tag. It causes the following material to be on a new
line, not on the end of the current line.


is the image tag. It specifies an image to be included in the
webpage. There is no content. There is notag. The image tag is
called avoid tagbecause it does not “mark up” any content. I know, it
seems like the picture itself is the content. But we count as content the
things that appear between the start tag and the end tag.

In our case,<img...>has two parameters: src= and width=. The img src
(source) gives a URL for the image source. The img width specifies that the
image should be shown a certain number of pixels wide, in this case 500.


Exam Question 2(p.336):What does URL stand for?
Acceptable Answer:uniform resource locator


Width: We specify width= because often pictures are so large that they
cannot be shown on the screen. By specifying width (or height, or both),
we tell the browser how large to display the image.


Exam Question 3(p.336): When we specify image width, does it affect
displayed size?
Required Answer:yes


Exam Question 4(p.336): When we specify image width, does it affect
download time?
Required Answer:no


1.2 A Word About Pixels


We mentioned pixels. We should explain a bit more about them. For our
purposes, the pixel is a unit of measure that tells the browser how big we
want things to be. Section 12.4 (page 133) talks more about the measure-
ment units that are available to us.


The Shrinking Real Pixel. Normally a pixel is onepictureelement.
That is where it gets its name. It is one dot on the computer screen, or one
blob of ink from an ink jet printer.


Over time, real pixels have been getting smaller and smaller. Printed things
like the letters of words are getting smoother and smoother. Screens have
gone beyond the point where the human retina can distinguish pixels without

Free download pdf