Most of the platforms I used to learn HTML and CSS I saw in Html that one can add an image from the websites (it goes like this, url alt="Black Mustang in New York City>) but I wonder how can I add picture from my collections of photos in my laptop? (I mean how can I use pics from my Pc and add them to the Html codes?)
Apart from that, these are very beautiful portfolios, they're truly inspirational
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');
}
Most of the platforms I used to learn HTML and CSS I saw in Html that one can add an image from the websites (it goes like this, url alt="Black Mustang in New York City>) but I wonder how can I add picture from my collections of photos in my laptop? (I mean how can I use pics from my Pc and add them to the Html codes?)
Apart from that, these are very beautiful portfolios, they're truly inspirational
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