How To Adjust The Length And Width Of An Image Using HTML: 4 Steps

In HTML, image height and width refer to the size of an image in pixels. Starting with HTML 4.01, the length and width of an image can be expressed in pixels or%. In HTML5, the length and width of the image must be in pixels. This article describes how to use HTML code to resize an image.

Go up one step

Cara Mengatur Panjang dan Lebar Gambar Menggunakan HTML: 4 Langkah

Open the HTML document in a text editor. Windows and Mac computers have text editing programs such as Notepad and text editors that you can use to create or edit HTML. You can open the HTML document in a text editor by clicking Open on the File menu . You can also right-click the file you want to edit and click Open With ….

Cara Mengatur Panjang dan Lebar Gambar Menggunakan HTML: 4 Langkah

Add the following to your script:

srcThe location of the image file.

altThe tag specified for the image .

The number entered is in pixels.

You can also use tags style. For example, this code is embedded in the text . The tag styleprevents the object from being resized and resists further resizing of the image.

Cara Mengatur Panjang dan Lebar Gambar Menggunakan HTML: 4 Langkah

heightChange the number width. For example, typing 21 for widthand area will heightresize the image to half its original size.

Cara Mengatur Panjang dan Lebar Gambar Menggunakan HTML: 4 Langkah

Save the file and open it in your browser to see the results. If you don’t like the result, repeat the above process.

Leave a Reply

Your email address will not be published.

Back to top button