问题
I need to add superscript in dropdownlist options. I tried many ways but nothing worked out. So help me to how to style a only a part of option text to make it appear like superscript. please help me,also if you know any other way to add superscript in dropdownlist options. thanks
回答1:
There is no way to do this in HTML/CSS/Javascript
However for all those trying to do it out of a <select>
tag, wrap the content you intend to superscript in a <span>
element and then apply CSS to it.
Example
HTML
<p>x<span class="superscript">2</span> = 9</p>
CSS
span.superscript { vertical-align: super; font-size:50%; }
Fiddle demo
来源:https://stackoverflow.com/questions/19519608/how-to-style-only-a-part-of-text-in-css