开发者

Specifying inline widths in css

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜