HTML DOM clear Property
Complete Style Object Reference
Definition and Usage
The clear property sets on which sides of an element other floating
elements are not allowed.
Syntax
Object.style.clear=left|right|both|none
|
Possible Values
Value |
Description |
left |
No floating elements allowed on the left side |
right |
No floating elements allowed on the right side |
both |
No floating elements allowed on either the left or the
right side |
none |
Allows floating elements on both sides |
Example
The following example disallows floating elements on the left side of the
text:
<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>
|
Try-It-Yourself Demos
Clear -
Clear left side of text from floating elements
Complete Style Object Reference
|
|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|