inline element is floated : Inline Elements « Style Basics « HTML / CSS






inline element is floated

 

<!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>float</title>
        <style rel='stylesheet' type='text/css'>

span#inline {
    float: left;
    background: khaki;
    border: 1px solid gold;
    padding: 5px;
    margin: 5px;
}
        
        </style>
    </head>
    <body>
      <p>
         <span id='inline'>
             block-level element with shrink-to-fit sizing.
         </span>
     </p>
 </body>
</html>

 








Related examples in the same category

1.CSS provides the following properties for styling inline boxes:
2.Inline Elements list
3.Inline Box
4.Shrinkwrapped inline block by setting both width and height to auto
5.On an inline-block element, a positive value in margin-top expands the height of the line and a negative value shrinks it.
6.Block-level elements
7.float inline block becomes block of multiline inline box
8.float inline with block inline padding
9.float inline elements becomes block
10.Middle Offset INLINE
11.Shrinkwrapped Absolute right aligned
12.Stretched Absolute in relative positioned parent
13.Middle Aligned INLINE