HTML CSS Reference/CSS Attributes and Javascript Style Properties/float

Материал из Web эксперт
Перейти к: навигация, поиск

"float" Example

    
<html>
<body>
<img id="myImage" 
     src="http://www.wbex.ru/style/logo.png" 
     border="0" 
     style="float:left">
<p style="font-family:verdana; 
          width=200; 
          cursor:hand">
     Move the mouse pointer here
</p>
<button onclick="myImage.style.styleFloat="right"">Change float to right</button>
</body>
</html>



"float" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <address>                     |
|                |<applet>                        <b>                           |
|                |<big>                           <blockquote>                  |
|                |<button>                        <center>                      |
|                |<cite>                          <code>                        |
|                |currentStyle                    <custom>                      |
|                |<dd>                            defaults                      |
|                |<dfn>                           <dir>                         |
|                |<div>                           <dl>                          |
|                |<dt>                            <em>                          |
|                |<embed>                         <fieldset>                    |
|                |<form>                          <hn>                          |
|                |<hr>                            <i>                           |
|                |<iframe>                        <img>                         |
|                |<inputtype="button">            <input type="checkbox">       |
|                |<input type="file">             <input type="image">          |
|                |<input type="password">         <input type="radio">          |
|                |<input type="reset">            <inputtype="submit">          |
|                |<input type="text">             <isindex>                     |
|                |<kbd>                           <label>                       |
|                |<legend>                        <li>                          |
|                |<listing>                       <marquee>                     |
|                |<menu>                          <object>                      |
|                |<ol>                            <p>                           |
|                |<pre>                           <rt>                          |
|                |<ruby>                          runtimeStyle                  |
|                |<s>                             <samp>                        |
|                |<select>                        <small>                       |
|                |<span>                          <strike>                      |
|                |<strong>                        style                         |
|                |<sub>                           <sup>                         |
|                |<table>                         <textarea>                    |
|                |<tt>                            <u>                           |
|                |<ul>                            <var>                         |
|                |<xmp>                                                         |
+----------------+--------------------------------------------------------------+



"float" Syntax and Note

Note:
Whether the text can flow to the left, or right of an element, or not at all. 
It is equivalent to the styleFloat JavaScript property.
    
Syntax:
    
element { float: value }