+ 2
How to change the size of an image HTML?
I have a picture that i want to put and its really big how can i changs it's size
6 Answers
+ 5
In HTML, the <img> tag has two main attributes for this:
width
height
All you need to do is to add the following:
<img src="my_image.jpg" alt="my image" height="127" width="127">
The above code will resize the image to 127x127px.
Hope it helps đ
+ 5
It is a pleasure đ
+ 3
hi ר××˘× ×××× ×
if you have a really big image and you include this original image in your website,
note this tip:
Downsizing a large image with the height and width attributes forces a user to download the large image (even if it looks small on the page). To avoid this, rescale the image with a program before using it on a page.
this is better for the performance of the website đ
https://www.w3schools.com/tags/att_img_width.asp
0
Thank You!
0
if you use an id element OR class element you can customize it through the css code, for example:
<img src =â#â id =âimageSizeSmallâ>
therefore the css code would be:
.imageSizeSmall{
(( insert customization here ))
}
This proves to be more useful since you can reuse it other than have inline styling to customize all the pictures/images in your website.