tags:

views:

34

answers:

3

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?

+1  A: 

inline-block.

meder
+2  A: 

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.

skajfes
+1  A: 

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

Nazariy
Nice! I did not know that. is that compatible cross browsers?
ming yeow
I'm 99% sure that it would would work in all browsers.
Nazariy