|
HTML DOM cssFloat Property
Complete Style Object Reference
Definition and Usage
The cssFloat property sets where an image or text will appear (float) in another
element.
Syntax
|
Object.style.cssFloat=left|right|none
|
Possible Values
| Value |
Description |
| left |
The image or text will float to the left in the parent
element |
| right |
The image or text will float to the right in the parent
element |
| none |
The image or the text will be displayed just where it
occurs in the parent element |
Tips and Notes
Note: If there is too little space on a line for the floating element,
it will jump down on the next line, and continue until a line has enough space.
Example
The following example sets the image to float to the left of the text:
<html>
<head>
<script type="text/javascript">
function setFloat()
{
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>
<input type="button" onclick="setFloat()"
value="Set image to float to the left" />
</body>
</html>
|
|
Complete Style Object Reference

Whether you're new to XML or already an advanced user,
the user-friendly views and powerful entry helpers,
wizards, and debuggers in XMLSpy are designed to meet your XML
and Web development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- XBRL validator & taxonomy editor
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a free trial today!
|
|
|
|