Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Creating Superscript and Subscript Text in CSS

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1
    • 0
    • 115
    Comment on it

    If you want to make your text superscript text(raises the text) or subscript text(lowers the text), css3 property can be used.
    CSS3 provides vertical-align property which can be used to make superscript or subscript effects in your HTML text of any web application. You can also do the same thing with html inline tags, but you should use css to get this effect. It will make your code more dynamic and also flexible.

    Lets see this by example. here is the text you want to make subscript or superscript within span tags with corresponding classes.  The HTML will look like this:

    <p>Some text Some text Some text<span class="supertext">Superscript text</span></p>
    <p>Regular text regular text regular text<span class="subtext">Subscript text</span></p>


    To make the text as superscript and subscript, you have to use the vertical-align property in your CSS file.
     

    .supertext{
     vertical-align: super;
     }
     .subtext{
     vertical-align: sub;
     }

    It will look like this:

     

    Creating Superscript and Subscript Text in CSS

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: