ÍøÂçѧԺ w3popÉçÇø ÍøÂç×ÊÔ´ ITÐÂÎÅ

w3pop.com :: ÍøÂçѧԺ :: HTML DOM :: HTML DOM heightÊôÐÔ

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

Íü¼ÇÃÜÂë? ×¢²á

HTML DOM heightÊôÐÔ


×÷Õß:w3pop.com ·­Òë/ÕûÀí:w3pop.com ·¢²¼:2007-04-28 ä¯ÀÀ:1406 :: ::

Definition and Usage
¶¨ÒåÓëÓ÷¨

The height property sets or returns the height of an image.
heightÊôÐÔ¿ÉÉèÖûò·µ»ØÍ¼Æ¬µÄ¸ß¶È

Syntax
Óï·¨

imageObject.height=pixels


Example
¾ÙÀý

<html>

<head>
<script type="text/javascript">
function changeSize()
{
document.getElementById("compman").height="250"
document.getElementById("compman").width="300"
}
</script>

</head>
<body>
<img id="compman" src="compman.gif" width="107" height="98" />

<br /><br />
<input type="button" onclick="changeSize()"
value="Change size of image">
</body>
</html>


Try-It-Yourself Demos
³¢ÊÔÓëÑÝʾ

Change the height and width of an image
¸Ä±äͼƬµÄ¸ß¶ÈºÍ¿í¶È

ÆÀÂÛ (0) All