开发者

Specifying inline widths in css

开发者 https://www.devze.com 2023-01-16 03:52 出处:网络
Suppose you have this html: <span> aaa </span> <a> bbb </a> <br> <span> ccccccc </span> <a>开发者_运维知识库 dddd </a>

Suppose you have this html:

<span> aaa </span> <a> bbb </a>
<br>
<span> ccccccc </span> <a>开发者_运维知识库 dddd </a>

You need the span to be of a certain width, so there is a certain layout.

How do you do this without resorting to floating divs?


You could style the spans to be display: block, or inline-block (IE sometimes has issues with this) and then define the width.

Why? Well, span is a inline elmenent, and you cannot define width and height on inline elements, so you must "convert" the span to a block element.


inline-block.


If you trying to create a table without a table check this example of definition list

0

精彩评论

暂无评论...
验证码 换一张
取 消