0

Putting spans inside of a sup doesn't apply expecting styling..

See Fiddle: https://jsfiddle.net/mkms1ozk/2/

You will notice the first abc has margin/padding and the abc included purely in a sup does not..

I would have thought the margin & padding of 0px would be applied to the span inside the sup..

Is this expected behavior?

For the lazy like me here is the entire HTML..

<html> <style> span{ margin:0px; padding:0px; } </style> <body> <sup> <span>a</span> <span>b</span> <span>c</span> </sup> <sup>abc</sup> </body> </html>

John McLear
  • 764
  • 1
  • 10
  • 20
  • It's whitespace. If you put all the span tags on one line, the spaces will go away. – user2182349 Feb 09 '16 at 02:25
  • That's because you have whitespace in your HTML. It's the same as [How to remove the space between inline-block elements?](http://stackoverflow.com/questions/5078239/how-to-remove-the-space-between-inline-block-elements) (even if `span` are inline by default instead of inline-block) – Oriol Feb 09 '16 at 02:28
  • 1
    @Oriol - technically there's [one technique for removing spaces between inline elements](https://jsfiddle.net/mkms1ozk/3/) that doesn't work with inline-block elements. Not sure how that should be covered. – Alohci Feb 09 '16 at 08:11

0 Answers0