subscript and superscript for the same element

前端 未结 2 555
孤街浪徒
孤街浪徒 2021-02-07 06:50

Is there any way to add both subscript and and superscript to the same element? If I do

Sample TextSubSup
         


        
2条回答
  •  长情又很酷
    2021-02-07 07:02

    I'm no CSS guru but you could try something along the lines of http://jsfiddle.net/TKxv8/1/

    There are a lot of hardcoded values and the effects on other elements around may only be found afterwards but it's a good place to start.

    Sample Text 
    
        Sup
        Sub
    
    
    .supsub {position: absolute}
    .subscript {color: green; display:block; position:relative; left:2px; top: -5px}
    .superscript {color: red; display:block; position:relative; left:2px; top: -5px}
    

提交回复
热议问题