You are here: Reference > CSS > properties > clear

clear property

Browser support:
Specifies the position of the element relative to floating objects.
JavaScript page for this property: clear. You can find other example(s) there.

Possible values:

 One of the following values: 
both
Prohibits to show floating objects on any side of the object.
left
Prohibits to show floating objects on the left side of the object.
none
Default. Allows to show floating objects on both sides of the object.
right
Prohibits to show floating objects on the right side of the object.
Default: none.

Example HTML code 1:

This example illustrates the use of the clear property:
<head>
    <style>
        .floating {
            float: left;
            background: cyan;
            height: 30px;
        }
        .clear {
            clear: left;
        }
    </style>
</head>
<body>
    <i class="floating">Floating element</i>
    <div class="clear">
        This sentence forbids floating elements on the left side.
    </div>

    <br /><br />
    
    <i class="floating">Floating element</i>
    <div>
        This sentence does not forbid floating elements on the left side.
    </div>
</body>
Did you find this example helpful? yes no

Supported by tags:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content