float inline becomes block with inline padding : float : Layout Attributes HTML CSS TUTORIALS


HTML CSS TUTORIALS » Layout Attributes » float »

 

float inline becomes block with inline padding


 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
   <html>
        <head>
            <title></title>
            <style type='text/css'>
                div {
                    margin: 10px;
                    background: rgb(200200200);
                    height: 100px;
                }
                span#floated {
                    background: rgb(220220220);
                    margin: 10px;
                    padding: 10px;
                    border: 1px solid black;
                    float: left;
                    width: 100px;
                }
                span#normal {
                    background: rgb(240240240);
                    border: 1px solid black;
                    margin: 100px;
                    width: 1000px;
                    padding: 50px;
                }
            </style>
        </head>
        <body>
            <div>
                <span id='floated'>
                    This span is floated left.
                </span>
                <span id='normal'>
                    The text of this span is beside the floated span.
                </span>
                This is extra text. This is extra text. This is extra text. 
                This is extra text. This is extra text. This is extra text.
                This is extra text. This is extra text. This is extra text.
                This is extra text. This is extra text. This is extra text.
                This is extra text. This is extra text. This is extra text.
                This is extra text. This is extra text. This is extra text.
            </div>
        </body>
    </html>

 



HTML code for linking to this page:

Follow Navioo On Twitter

HTML CSS TUTORIALS

 Navioo Layout Attributes
» float