January 2018
Intermediate to advanced
678 pages
20h 16m
English
img ElementNow that you know about image file formats, it’s time to focus on the nuts and bolts of how to display an image on a web page. In Chapter 4, we introduced the img element, which displays images. In this section, we’ll review what you learned and provide more details.
Let’s jump right into an img element example:
<img src="../images/winkingSmiley.gif" alt="Winking Smiley Face" width="50" height="50">
The src attribute specifies the image’s filename and the location of the image’s file. In this img element, the filename is winkingSmiley.gif. The location is indicated by the path that comes before the filename. The path that comes before winkingSmiley.gif is ../images/. Do you remember what the .. is for? The .. says to move ...
Read now
Unlock full access