Prevent Superscripts and Subscripts from Affecting Line-Height

Posted on Monday, June 29, 2015 at 2:48 PM into css & code by Steve Woods.
Roughly a 1 minute read.

Sometimes it's problematic to use a tag in your code because it puts a gap between two lines in a paragraph making it look incorrect - here's how to solve it.

Add this to your CSS file:

sup, sub {
   vertical-align: baseline;
   position: relative;
   top: -0.4em;
}
sub { top: 0.4em; }

 

;

Comments

Please consider what you post!
Chillax if you're angry.