Refix #222 and #248

Using inline-block makes the whole thing easier and more stable.