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
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 ….
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.
heightChange the number
width. For example, typing 21 for
widthand area will
heightresize the image to half its original size.
Save the file and open it in your browser to see the results. If you don’t like the result, repeat the above process.