span with vertical align : span align « Tags « HTML / CSS






span with vertical align

    
<!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'>
                p {
                    background: #ccc;
                    margin: 10px;
                    font-size: 16px;
                }
                span {
                    font-weight: bold;
                    background: lightblue;
                }
                span > span {
                    font-size: 40px;
                    color: white;
                    background: steelblue;
                }
                span + span {
                    font-size: 20px;   
                }
                span#text-top {
                    vertical-align: text-top;
                }
                span#top {
                    vertical-align: top;
                }
                span#text-bottom {
                    vertical-align: text-bottom;
                }               
                span#bottom {
                    vertical-align: bottom;
                }
            </style>
        </head>
        <body>
            <p>
                <span>
                    This is a test. 
                        <span id='text-top'>top</span> 
                        <span id='top'>top</span>
                </span>
            </p>
            <p>
                <span>
                    This is a test. 
                        <span id='text-bottom'>bottom</span>
                        <span id='bottom'>bottom</span>
                </span>
            </p>
        </body>
    </html>

   
    
    
  








Related examples in the same category

1.span vertical-align: sub;
2.span vertical-align: super;
3.span vertical-align: 300%;
4.span vertical-align: top;
5.span vertical-align: middle;
6.span vertical-align: bottom;
7.inline vertical-align: top
8.inline vertical-align: middle
9.Inline vertical-align: bottom