span vertical-align: top; : span align « Tags « HTML / CSS

span vertical-align: top;


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns='' xml:lang='en'>
<style type='text/css'>
p {
    font: 12px sans-serif;
span.line {
    border: 1px solid rgb(200, 200, 200);
    background: rgb(244, 244, 244);
    font-size: 100px;
span.line span {
    vertical-align: 300%;
    font-size: 20px;
    background: white;
    border: 1px solid black;
span#top {
    vertical-align: top;
span#middle {
    vertical-align: middle;
span#bottom {
    vertical-align: bottom;
span#text-top {
    vertical-align: text-top;
span#text-bottom {
    vertical-align: text-bottom;

            The vertical-align property is used in two scenarios: to
            vertically align inline elements with respect to the line
            box, and to vertically align the contents of table cells.
            When vertically aligning inline elements within a line box,
            the vertical-align property can be used with the keywords
            top, middle, bottom, text-top, text-bottom.
            <span class='line'>
                <span id='top'>Top</span>
                <span id='middle'>Middle</span>
                <span id='bottom'>Bottom</span>
                <span id='text-top'>Text Top</span>
                <span id='text-bottom'>Text Bottom</span>


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: middle;
5.span vertical-align: bottom;
6.span with vertical align
7.inline vertical-align: top
8.inline vertical-align: middle
9.Inline vertical-align: bottom