i need to set a image at 128*128px on a html page. i know the way width="128px" height="128px" but are i can do it by write a parameter on image like param="128px" then he set width and height 128px;
+1
A:
This can be used:
<img src="logo_w3s.gif" alt="W3Schools.com" height="100" width="100" />
Look here for complete syntax: http://www.w3schools.com/tags/tag_IMG.asp
PlanetMaster
2010-05-10 09:30:15
i know it i want to know about a parameter set not both ex: size=128 then he automatically set width height to 128
4thpage
2010-05-10 09:33:48
i know it i want to know about a parameter set not both ex: size=128 then he automatically set width height to 128
4thpage
2010-05-10 09:35:59
+1
A:
If you give only one argument to the tag it will automatically calculate the second, but it will always maintain the aspect ratio of the image.
If you need to set the w/h to the same in images with ratio different than 1/1 you'll need to use some javascript to retrieve the height or the width and give the same value to the other argument using JS.
Adirael
2010-05-10 09:36:05
are this problem not solved in html. it is not suite then for a small stuff i write more javascript
4thpage
2010-05-10 09:41:59