HTML DOM content attribute
Tukuyin at Paggamit
Ang content attribute ay nagtatakda kung saan ang teksto o imaheng magpapakita (floating) sa ibang elemento.
Gramata:
Object.style.content=value
Mga posibleng halaga
Halaga | Paglalarawan |
---|---|
string | Tukuyin ang nilalaman ng teksto. |
url | Tukuyin ang URL. |
|
|
attr(X) | Tukuyin ang mga katangian ng selector na nasa harap o sa likod ng selektor na ito. |
pagbubukas | |
pagbubukas | |
walang-pagbubukas | |
walang-pagbubukas |
Mga paalala at Komentaryo
Komentaryo:Kung mayroong kulang na espasyo sa isang linya para sa floating element, ang elemento ay magpunta sa susunod na linya, at ito ay magpapatuloy hanggang may sapat na espasyo sa isang linya.
Komentaryo:Ang nilalaman ng elemento sa loob, ang background at ang border ay dapat lumabas bago ang floating element. Ang background at ang border ng bloke element ay dapat lumabas pagkatapos ng floating element, ngunit ang nilalaman ng bloke element ay dapat lumabas bago ang floating element.
Example
This example sets the image to float on the left:
<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>