content 属性设置文本或图像出现(浮动)在另一个元素中的什么地方。
</>code
- Object.style.content=value
值 | 描述 |
---|---|
string | 定义文本内容。 |
url | 定义 url。 |
|
|
attr(X) | 定义显示在该选择器之前或之后的选择器的属性。 |
open-quote | |
close-quote | |
no-open-quote | |
no-close-quote |
注释:如果在一行中对于浮动元素而言空间太少,则这个元素会跳到下一行,这个过程会持续到有足够空间的一行为止。
注释:行内元素的内容、背景和边框应该出现在浮动元素之前。块级元素的背景和边框应当出现在浮动元素之后,但是块级元素的内容应当在浮动元素的前面。
本例设置图像浮动于左边:
</>code
- <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>
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛
Powered by 365建站网 RSS地图 HTML地图
copyright © 2013-2024 版权所有 鄂ICP备17013400号