HTML DOM clear ÊôÐÔ

HTML DOM Style ¶ÔÏó

¶¨ÒåºÍÓ÷¨

clear ÊôÐÔÉèÖÃÒ»¸öÔªËØµÄ²àÃæÊÇ·ñÔÊÐíÆäËûµÄ¸¡¶¯ÔªËØ¡£

Óï·¨£º

Object.style.clear=left|right|both|none

¿ÉÄܵÄÖµ

Öµ ÃèÊö
left ÔÚ×ó²à²»ÔÊÐí¸¡¶¯ÔªËØ
right ÔÚÓҲ಻ÔÊÐí¸¡¶¯ÔªËØ
both ÔÚ×óÓÒÁ½²à¾ù²»ÔÊÐí¸¡¶¯ÔªËØ
none ĬÈÏ¡£ÔÊÐí¸¡¶¯ÔªËسöÏÖÔÚÁ½²à¡£

ʵÀý

±¾Àý²»ÔÊÐíÎı¾×ó±ßµÄ¸¡¶¯ÔªËØ£º

<html>
<head>
<style type="text/css">
img 
{
float:left;
}
</style>
<script type="text/javascript">
function clearLeft()
{
document.getElementById("p1").style.clear="left";
}
</script>
</head>
<body>

<img src="logocss.gif" width="95" height="84" />

<p id="p1">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="clearLeft()"
value="Clear left side of text" />

</body>
</html>

HTML DOM Style ¶ÔÏó

VUE