Loading…
Everything will be ready in few seconds
- Theory
- Theory
- Comments
The img tag for images
We can easily see that on our Website of a Beginning Coder that there are no images at all. However, well-chosen images that are the right size and are displayed without errors are the key to a successful business. Therefore, Muffin gave us a new assignment: to understand all the formats and uses of images.
To do this, he sent us the layout of our blog with images. We have already saved them to the right folder. All you need to do is load them in their proper places within the layout.
So, let’s take a look at how to load images. To do this, we use the tag <img>
. This is a single tag, which we already know about. It does not have a closing tag. The <img>
tag by itself is useless without its src
attribute, which indicates the path and the name of the image.
<img src="logo.png">
Let’s load an avatar image on the main page.
- index.html
- style.css
Thanks! We’ll fix everything at once!
Comments