HTML DOM cssFloat ÊôÐÔ
¶¨ÒåºÍÓ÷¨
ÉèÖÃÎı¾»òͼÏñ³öÏÖ£¨¸¡¶¯£©ÔÚÁíÒ»¸öÔªËØÖеÄʲôµØ·½¡£
Óï·¨£º
Object.style.cssFloat=left|right|none
¿ÉÄܵÄÖµ
| Öµ | ÃèÊö |
|---|---|
| left | ͼÏñ»òÎı¾¸¡¶¯ÔÚ¸¸ÔªËصÄ×ó±ß¡£ |
| right | ͼÏñ»òÎı¾¸¡¶¯ÔÚ¸¸ÔªËصÄÓұߡ£ |
| none | ͼÏñ»òÎı¾¸¡¶¯ÏÔʾÔÚËüÔÚ¸¸ÔªËØÖгöÏÖµÄλÖᣠ|
ÌáʾºÍ×¢ÊÍ
×¢ÊÍ£ºÈç¹ûÔÚÒ»ÐÐÖжÔÓÚ¸¡¶¯ÔªËضøÑÔ¿Õ¼äÌ«ÉÙ£¬ÔòÕâ¸öÔªËØ»áÌøµ½ÏÂÒ»ÐУ¬Õâ¸ö¹ý³Ì»á³ÖÐøµ½ÓÐ×ã¹»¿Õ¼äµÄÒ»ÐÐΪֹ¡£
ʵÀý
±¾ÀýÉèÖÃͼÏñ¸¡¶¯ÓÚ×ó±ß£º
<html>
<head>
<script type="text/javascript">
function setFloat()
{
document.getElementById("img1").style.cssFloat="left";
}
</script>
</head>
<body>
<img id="img1" src="logocss.gif" />
<p>This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.</p>
<input type="button" onclick="setFloat()"
value="Set image to float to the left" />
</body>
</html>
TIY
- cssFloat - ÉèÖÃͼÏñ¸¡¶¯ÓÚÎÄ×ÖµÄ×ó±ß£¨ÇëÔÚ·Ç IE ä¯ÀÀÆ÷Öв鿴£©