display: inline-block

Remember how we saw we can float things?
display: inline-block gives us another way to achieve similar results -- but with inline-block, the contents are not taken out of the calculation of the parent container!

inline-block

Compare the two JSFiddle examples of li:

Copyright © David Heitmeyer