Specify the width and width of a photo (photo size), with the width and height characteristics in HTML

t should be noted that if the size of the photo is smaller than the size set, then the photo may not display well in quality, so these features are usually used to display a photo for a smaller one.

How to use the width and height attributes in HTML is as follows:

img src “logo.png” width “50px” height “60px” / >

Where px is the pixel unit.

Take note of the example below:


First, once we display the image in a normal way and then display it with a smaller size:

Html > head > head > 
body > 
img src “image.png” / > 
br / > < br / > 
img src “image.png” width “30px” height “30px ” / > 
body > html >

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top