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

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

»áÔ±µÇ½

ÕʺÅ

ÃÜÂë

»Ø´ð

¼ÇסÃÜÂë

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

HTML DOM alignÊôÐÔ


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

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

The align property sets or returns how to align an image according to the surrounding text.
alignÊôÐÔ¿ÉÉèÖûò·µ»ØÔõÑùÈÃͼƬ¸ù¾ÝÖÜΧÎÄ×ÖÀ´½øÐÐ¶ÔÆë

Syntax
Óï·¨

imageObject.align=left|right|top|middle|bottom


Example
¾ÙÀý

The following example aligns the image to the right according to the surrounding text:
ÏÂÃæµÄ¾ÙÀý½«Í¼Æ¬¶ÔÆëµ½ÎÄ×ÖµÄÓұߣº

<html>

<body>
<img id="compman" src="compman.gif" alt="Computerman" />
<p>Some text. Some text. Some text. Some text.</p>
<script type="text/javascript">
document.getElementById("compman").align="right";
</script>
</body>
</html>


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

Set the alignment of an <image> element
ÉèÖÃ<image>ÔªËØµÄ¶ÔÆë·½Ê½

ÆÀÂÛ (0) All