Search code examples
htmlcssmarkup

Html upper and lower indecies


any ways to put into html using css upper or lower indecies like: ¹ or ₁ (I also need latin letters).


Solution

  • HTML TAGS: try sup and sub tags,...

    Demo

    Other Option Using css:

    .sup,
    .sub {
      height: 0;
      line-height: 1;
      vertical-align: baseline;
      _vertical-align: bottom;
      position: relative;
    }
    
    .sup {
      bottom: 1ex;
    }
    
    .sub {
      top: .5ex;
    }
    text <span class=sup>upper</span><span class=sub>lower</span>