block multiline inline box model with margin and padding : Box model Basics : Box Model HTML CSS TUTORIALS


HTML CSS TUTORIALS » Box Model » Box model Basics »

 

block multiline inline box model with margin and 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: #aaa;
                    height: 100px;
                }
                span#floated {
                    background: #ccc;
                    margin: 10px;
                    padding: 10px;
                    border: 1px solid black;
                    float: left;
                    width: 100px;
                }
                span#normal {
                    background: #ddd;
                    border: 1px solid black;
                    opacity: 0.7;
                    padding: 20px;
                    margin: 20px;
                }
            </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.
                    The text of this span is beside the floated span.
                    The text of this span is beside the floated span.
                    The text of this span is beside the floated span.
                    The text of this span is beside the floated span.
                    The text of this span is beside the floated span.
                    The text of this span is beside the floated span.
                </span>
                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 Box Model
» Box model Basics