You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is tested to not break line-heights in WinXP/IE6, WinXP/IE7, WinXP/IE8, Mac/FF 3.5.9, Mac/Chrome 5.0, Mac/Safari 4.0.4, assuming a base font size of 14px and a line-height of 21px, or 1.5em. Poke this, try to make it break!
michaeladamek: I'm unable to replicate this issue -- https://jsfiddle.net/ksZrh/ works fine in Safari 5.0.5. Can you link to a test case that shows the breakage you're talking about?
Yep. Breaks for me in Chrome 14. Note the link under the (R) symbol in the link.
Image taken from this text page: https://jsfiddle.net/ksZrh/
Thanks,
Michael
Seems like the best solution here would be to simply lose the underline style on link sup/sub blocks, though when I tried that out earlier I couldn't get that destyling to apply. Anyone else able to make the fiddle display that way?
As michaeladamek points out, the glyphs for the (R) and (C) symbols aren't superscripted by default like the (TM), degree, spanish ordinal operators (a) and (o), and some other glyphs are.
Turns out that if you apply an underline to any glyph that isn't superscripted by default, it will render inconsistently between Webkit and non-Webkit browsers, because Webkit browsers superscript the underline and the glyph, while non-Webkit browsers superscript only the glyph. Whether the underline is applied via a border-bottom or text-decoration:underline declaration doesn't seem to make a difference, unfortunately.
Interesting: a potential approach to getting underlines by using gradients rather than border-bottom or text-decoration. Lost the link to the tweet, but credit goes to @chikuyonok -- https://jsfiddle.net/yyHNp/5/
Having a strange issue with IE7. I have a large content (Terms etc.) inside a fixed height div with scroll: auto. There are a lot of sup tags inside. These show up below the div and for the full length of the content.
Disclaimer: I don't know what this GitHub is and they are not allowed to bill me for anything, I just want to comment on this excellent post.
I use sub and sup a lot and specially with the old Explorers and now with the new Firefox 27 you run into troubles that only the here proposed CSS can save you from. Well done!
In special cases a subscript or superscript can be given
margin-left: -1px;
margin-right: 1px;
depending on the context.
Also a paragraph can be given some extra line-height when sub and sup appear in it.
@unruthless Trying the full test linked above, with Firefox 35.0.1 (current), now it behaves like Chrome as well, breaking the text decoration with superscipt.
@unruthless@michaeladamek -- Not sure of the complete x-browser implications (will test IE/Safari tomorrow), but one way to remove the text-decoration from <sub> and <sup> is to display: inline-block. https://jsfiddle.net/kaidjohnson/89jdwp0f/ Seems cleaner than adding more selectors, but full browser testing is still needed on this example.
This is tested to not break line-heights in WinXP/IE6, WinXP/IE7, WinXP/IE8, Mac/FF 3.5.9, Mac/Chrome 5.0, Mac/Safari 4.0.4, assuming a base font size of 14px and a line-height of 21px, or 1.5em. Poke this, try to make it break!