I have this code here in order to create a tag cloud, the tags are <a>‘s and inside it I insert a span with the tag’s count inside it.
I want them to be always together but in some cases the line breaks although I have the “display: inline” set for the <a> just in case, still it does not work.
Both
aandspanelements are inline by default. Your problem is that inline elements are word-wrapped, and that works per-word, not per-element.Either disable word wrapping with
white-space: nowrapor make the outer elementdisplay: inline-blockto make it wrap as a complete element.