Use clear to start a new line : Block Elements : Style Basics HTML CSS TUTORIALS


HTML CSS TUTORIALS » Style Basics » Block Elements »

 

Use clear to start a new line


 



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en'>
    <head>
        <title></title>
        <style rel='stylesheet' type='text/css'>

div#container {
    border: 1px solid black;
    margin: 0 20px;
    background: pink;
    padding: 5px;
}

div#float {
    text-align: center;
    float: left;
    width: 150px;
    height: 150px;
    border: 1px solid blue;
    background: gold;
}
div.content {
    background: yellow;
    border: 1px solid  purple;
}
div#clear {
    border: 1px solid red;
    background: orange;
    clear: both;
}        
        </style>
    </head>
    <body>
        <div id='container'>
            <div id='float'>
                Float text. 
            </div>
                Content text. 
            <div class='content'>
                Content text. 
            </div>
                Content text. 
            <div class='content'>
                Content text. 
            </div>
                Content text. 
            <div class='content'>
                Content text. 
            </div>
                Content text. 
            <div id='clear'>
                Clear text. 
            </div>
            <div>
                Another div.
            </div>
        </div>
    </body>
</html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Style Basics
» Block Elements