HTML5, CSS3, and JavaScript Fourth Edition

(Ben Green) #1

CHAPTER 21. WORKING OFFLINE 226


it, it has not changed, what is probably the cause?
Acceptable Answer:cache or caching


Exam Question 347(p.357):If you change a webpage, but when you visit
it, it has not changed, what should you do?
Acceptable Answer:reload or refresh


21.8 Adding a Photo


Place a photograph into the same folder. We will assume you called it
myphoto.jpgfor this example. If you called it something else, hopefully
you can figure out what to do.


Modify your webpage by adding a line at the end, as follows:


This is Don's webpage.


This is normal text.
This is bold text.
This is normal text.
This is italic text.
This is normal text.

Save it and view your page again. The picture should now appear after the
text of your webpage.


The source can be any URL that resolves to a picture. However, some
websites intentionally block outside linking to their media. They consider it
to beleeching. See section 19.8.3 (page 216) for details.


Depending on where your photo came from, it might be normally sized or
it might be really big. We can fix that. Add a width parameter to your img
line as follows:



The width parameter specifies the display width of your picture in pixels.
It says that no matter what your picture’s natural size is, make it look like
it is 500 pixels wide. (There is also a height parameter.)

Free download pdf