To insert an image on a website via HTML, you can use the <img> tag and use the src attribute to specify the path to the image relative to the html file. Let's say you have a file index.html and next to it there is a folder images and in it a picture car.jpg. In that case, it's for you need to write the img tag like this: <img src="images/car.jpg">
Or you can use css. To do this, write the background-image property in the class, and then use the url to specify the path to the image.
Example:
.image {
background-image: url('images/car.jpg');
}
To insert an image on a website via HTML, you can use the
<img>
tag and use thesrc
attribute to specify the path to the image relative to the html file. Let's say you have a fileindex.html
and next to it there is a folderimages
and in it a picturecar.jpg
. In that case, it's for you need to write the img tag like this:<img src="images/car.jpg">
Or you can use
css
. To do this, write thebackground-image
property in the class, and then use the url to specify the path to the image.Example:
.image {
background-image: url('images/car.jpg');
}
Thank you very much