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

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

"clear" Example

    
<html>
<head>
<style>
#secL { 
   position:absolute; 
}
.style1 { 
   clear:left!important; 
}
.style2 { 
   clear:none!important; 
}
</style>
</head>
<body>
    <img src="http://www.wbex.ru/style/logo.png" 
         width="71" 
         height="99" 
         style="float:left">
        <a id="myL" 
           href="http://www.wbex.ru" 
           onClick="this.className="style2";return false" 
           onMouseOver="this.className="style1"">
           Disabled link
        </a>
    <img src="http://www.wbex.ru/style/logo.png" 
         alt="This is a float=right image" 
         width="79" 
    height="99">
</body>
</html>



"clear" is applied to

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



"clear" Possible Values

Possible Values
both         No floating objects are allowed on the left and right sides
left         The left side is kept clear
right        The right side is kept clear
none         The default;floating objects are allowed on the left and right sides



"clear" Syntax and Note

Note:
Whether the element allows other floating objects on its sides.
Syntax:
    
element { clear: value }
elementID.style.clear = "value"
document.all.elementID.style.clear = "value" // IE only