|
Cookbook /
SuperscriptLineSpacingSummary: How to fix line spacing of superscripts and subscripts
Version:
Prerequisites:
Status:
Maintainer:
Categories: Layout, Administration
QuestionHow can I fix line spacing of {^superscripts^} and {_subscripts_}? AnswerThe solution is to add the following to the style sheet:
#wikitext { line-height: 1.3em; }
#wikitext sub, #wikitext sup { line-height: 0; }
This can be done by adding the above lines to pub/css/local.css or by adding the following code into the config.php file:
$HTMLStylesFmt[] = "
#wikitext { line-height: 1.3em; }
#wikitext sub, #wikitext sup { line-height: 0; }
";
DiscussionNormally, browsers display running prose with even line spacing. However, if the text happens to include superscript or subscript text, then most browsers render this with uneven line spacing. This looks ugly and distracts the reader from the content. The fix is to modify the page's CSS rendering of <sup> and <sub> elements so that superscripts and subscripts do not change the current line's height, as given by the CSS statements above. This paragraph demonstrates how superscripts and subscripts are rendered when the above styles are included. See AlsoMarkupExtensions includes these styles settings. Contributors |