I'm trying to create a text editor using jQuery and execCommand
. Everything was going good until I noticed that both superscript
and subscript
aren't properly toggling.
This jsFiddle (http://jsfiddle.net/k8F4P/) should illustrate the problem.
It is possible that it is simply my browser, but I'm using the latest version of Chrome for Mac.
Turned out the issue was that the stylesheet
normalize.css
was setting thesub
andsup
tags'vertical-align
tobaseline
and this was preventing the correct toggling, but only in Chrome. The simple solution is to setsub
tovertical-align: sub
andsup
tovertical-align: super
.