views:

28

answers:

3

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
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
+1  A: 

In CSS:

img
{
height: 128px;
width: 128px;
}
Kyle Sevenoaks
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
Adirael's answer might be more beneficial to you then.
Kyle Sevenoaks
+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
are this problem not solved in html. it is not suite then for a small stuff i write more javascript
4thpage