Setting the width of inline elements

2019-01-02 15:28发布

You can set the width of inline elements like <span>, <em> and <strong>, but you won’t notice any effect until you position them.

a) I thought the width of inline an inline element can’t be set?

b) Assuming width can be set - we won’t notice any effects ( thus the width we specify ) until we position inline element. Position how/where?

c) Why is the width of inline elements apparent only when we “position” them?

标签: html css xhtml
7条回答
初与友歌
2楼-- · 2019-01-02 16:27

There's also the option of display: inline-block, which might give you the best of both worlds.

查看更多
登录 后发表回答