五月综合缴情婷婷六月,色94色欧美sute亚洲线路二,日韩制服国产精品一区,色噜噜一区二区三区,香港三级午夜理伦三级三

您現(xiàn)在的位置: 365建站網(wǎng) > 建站教程 > JavaScript 教程 > HTML DOM clear 屬性

HTML DOM clear 屬性

此節(jié)有 171 人學(xué)習(xí)過     參與評論

定義和用法

clear 屬性設(shè)置一個元素的側(cè)面是否允許其他的浮動元素。

語法:

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

可能的值

描述
left 在左側(cè)不允許浮動元素
right 在右側(cè)不允許浮動元素
both 在左右兩側(cè)均不允許浮動元素
none 默認(rèn)。允許浮動元素出現(xiàn)在兩側(cè)。

實例

本例不允許文本左邊的浮動元素:

<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>

如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答??! 點擊進入論壇

發(fā)表評論 (171人查看0條評論)
請自覺遵守互聯(lián)網(wǎng)相關(guān)的政策法規(guī),嚴(yán)禁發(fā)布色情、暴力、反動的言論。
昵稱:
最新評論
------分隔線----------------------------
JavaScript 教程目錄

其它欄目

· 建站教程
· 365學(xué)習(xí)

業(yè)務(wù)咨詢

· 技術(shù)支持
· 服務(wù)時間:9:00-18:00
365建站網(wǎng)二維碼

Powered by 365建站網(wǎng) RSS地圖 HTML地圖

copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號