content 屬性設(shè)置文本或圖像出現(xiàn)(浮動)在另一個(gè)元素中的什么地方。
Object.style.content=value
值 | 描述 |
---|---|
string | 定義文本內(nèi)容。 |
url | 定義 url。 |
|
|
attr(X) | 定義顯示在該選擇器之前或之后的選擇器的屬性。 |
open-quote | |
close-quote | |
no-open-quote | |
no-close-quote |
注釋:如果在一行中對于浮動元素而言空間太少,則這個(gè)元素會跳到下一行,這個(gè)過程會持續(xù)到有足夠空間的一行為止。
注釋:行內(nèi)元素的內(nèi)容、背景和邊框應(yīng)該出現(xiàn)在浮動元素之前。塊級元素的背景和邊框應(yīng)當(dāng)出現(xiàn)在浮動元素之后,但是塊級元素的內(nèi)容應(yīng)當(dāng)在浮動元素的前面。
本例設(shè)置圖像浮動于左邊:
<html>
<head>
<script type="text/javascript">
function setFloatLeft()
{
document.getElementById("img1").style.cssFloat="left";
}
</script>
</head>
<body>
<img id="img1" src="logocss.gif" width="95" height="84" />
<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>
<form>
<input type="button" onclick="setFloatLeft()" value="Set image to float left" />
</form>
</body>
</html>
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答??! 點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號