If I have a character (say “+”) inside text and I would like to place it in a bordered box, I can just wrap it in a span and set border: solid 1px of course. But what if I wish to have specific dimensions for the box, like 0.5em by 0.5em? By default, span is inline, so width and height are ignored.
I thought setting display: inline-box would help, but this seems to cause the borders to be drawn in odd ways, so that the character is not in the box at all, and differently in different browsers; see http://jsfiddle.net/csMLu/
Is there something I need to set on the element, or is there a better basic approach?
Setting
line heightandtext-alignseems to make it work, however the0.5emcontainer is to small for the text.