1

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?

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

Comments

1

inline-block.

Comments

1

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

1 Comment

Nice! I did not know that. is that compatible cross browsers?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.