why don't inline-block elements shrink wrap when text wraps

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Post Reply
Bethrezen
Posts: 445
Joined: September 13th, 2003, 11:56 am

why don't inline-block elements shrink wrap when text wraps

Post by Bethrezen »

Hi all

So I have a devilishly tricky issue, here is a screen shot to explain.

Image

In this screen shot you can clearly see the problem, in the box on the left the anchor is set to display: inline-block; and shrink wraps its text as expected.

However in the box or the right something is wrong, the text has wrapped to a new line since it's too big to fit on one line, yet despite also being set to display: inline-block the anchor fails to shrink wrap its text.

Now As you can see in this screen shot

Image

If I explicitly set a line brake via the <br> tag, then the anchor correctly shrink wraps its text as expected.

So my question is how can I get the anchor to shrink wrap its text when that text wraps to a new line without having to go through the html adding zillions of brake tags which is rather messy.

Surly there is a better way ?!?!
User avatar
jscher2000
Posts: 11742
Joined: December 19th, 2004, 12:26 am
Location: Silicon Valley, CA USA
Contact:

Re: why don't inline-block elements shrink wrap when text wr

Post by jscher2000 »

Why use inline-block instead of defaulting to inline?
Post Reply