Html upper and lower indecies

前端 未结 4 1917
南方客
南方客 2021-01-19 00:21

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

4条回答
  •  猫巷女王i
    2021-01-19 01:02

    
    ...    
    a (subscript)
    a (superscript)
    

    Tune the values as desired. In particular, you may wish to use different classes for different situations, especially depending on the letter that a superscript is attached to. For example, after an uppercase letter like “A,” a superscript should be placed considerably higher.

    Why classes and CSS?

    Although HTML appears to have just the right markup for this, sup and sub, they have several drawbacks. Their rendering is inconsistent across browsers and often typographically poor: both the vertical placement and the size can inadequate. It might seem easy to fix this in CSS, but it isn’t, due to an odd IE bug with sizing them: it interprets percentages incorrectly. Moreover, sup and sub often create uneven line spacing.

    If you intend to use sup and sub, run some tests before starting to use them extensively. Test on a few browsers and with superscripts and subscripts inside text paragraphs (so that you see the line spacing issue).

提交回复
热议问题