When vertically aligning inline elements,the vertical-align property can be: top, middle, bottom, text-top, text-bottom. : span text « Tags « HTML / CSS






When vertically aligning inline elements,the vertical-align property can be: top, middle, bottom, text-top, text-bottom.

    


      <!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>vertical-align</title>
              <style rel='stylesheet' type='text/css'>
      p {
          font: 12px sans-serif;
      }
      span.line {
          border: 1px solid rgb(200, 200, 200);
          background: red;
          font-size: 100px;
      }
      span.line span {
          vertical-align: 300%;
          font-size: 20px;
          background: white;
          border: 1px solid black;
      }
      span#top {
          vertical-align: top;
      }
    
              </style>
          </head>
          <body>
             
              <p>
                  <span class='line'>
                  CSS
                      <span id='top'>Top</span>

                  </span>
           </p>
        </body>
      </html>

   
    
    
  








Related examples in the same category

1.Span text-transform: uppercase;
2.Span text-align: center;
3.span text-decoration: underline;
4.span text-decoration: overline;
5.span text-decoration: line-through;
6.span text-decoration: blink;
7.span text-decoration: underline overline;
8.span text-decoration: underline line-through;
9.span text-decoration: overline line-through;
10.span text-transform: lowercase;
11.span text-transform: capitalize;
12.span vertical-align: text-top;
13.span vertical-align: text-bottom;
14.text-indent does not work on inline elements
15.Inline vertical-align: text-bottom
16.Inline vertical-align: text-top