zerowords zerowords - 6 months ago 10
HTML Question

display: inline-block does not produce horizontal result

This fiddle shows my problem.

The output include only 2 yellow boxes, but there could be more. I want the boxes to display horizontally, not vertically as they now display. I have attempted to use

display: inline-block
to accomplish my goal, but to no avail. How can I get the boxes to display horizontally?

Answer

add float: left to .sticky (and some margin left or/and right):

https://jsfiddle.net/Lcrysuzy/