I'm learning css and was struggling to understand why the html is rendering like so:
I can understand why the the red border is being cut off from the top and left. It's because outlines don't take up space since they're drawn outside of the box: https://developer.mozilla.org/en/CSS/outline. In this example they're being drawn outside of the <body>
element.
However I was confused as to why border is being cut off from the top. Any ideas?
What css can be applied to the
<span>
element to make the entire outline and border display?Also, is it ever considered okay to place an inline element next to a block element like
<span>somestuff</span><div>somecontent</div>
?