I know this is very basic CSS. How do I keep the span contained within the div? At the moment, the span extends outside the top and bottom of the div.
To answer your question, this isn't just an issue with padding or margin, but also with width, display, and the box model.
padding
margin
jsFiddle
span { display: inline-block; }
This will honor any padding, margins, or widths you apply to the span.