Is it possible to use superscript in the value field of the (for example, for use with th...">

HTML superscript text <input type = "submit" / ">

Is it possible to use superscript in the value field of the <input> (for example, for use with the registration mark)?

 <input type="submit" name="submit" value="Sometext&reg;"/> 
+3
source share
3 answers

You can use the <button type="submit"> element instead of the <input type="submit"> Then you can include any markup in the description, for example, <sup> for superscript text:

 <button type="submit">someText with <sup>superscripted parts</sup> </button> 
+9
source

Or using CSS:

http://jsfiddle.net/jxmaA/

HTML

 <button class="tradeMark" type="submit">someText with</button> 

CSS

 .tradeMark:after{ content: ' ©'; font-size:xx-small; vertical-align:top; } 

EDIT: this solution will not work with <input type="submit"/> either, because: after and: before are not applied ...

+2
source

If you should use <input type=submit> rather than <button type=submit> , you're out of luck. The text should be specified in the value attribute, which is taken as plain text. You can use superscript characters such as "²", but there is a superscript version of "®" as a character, but its appearance varies greatly in all fonts, being much more superscript in some fonts than, for example, in Arial.

Thus, a practical step may be to specify a different font for the button. For consistency, you probably want to use the same font for all the text of the submit buttons, for example.

 input[type=submit] { font-family: Calibri; } 

Usual CSS warnings are used. In particular, in this context it can be difficult to specify a good list of font families. (Caliber is wonderful, but its availability is far from universal.)

+1
source

Source: https://habr.com/ru/post/1208249/


All Articles