Closed Bug 377003 Opened 17 years ago Closed 17 years ago

block-elements like <br>, <div>, display:block breaks inline-block

Categories

(Core :: Layout: Block and Inline, defect)

defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 9458

People

(Reporter: adressler, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20070220 Firefox/2.0.0.2
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20070220 Firefox/2.0.0.2

All block-generating elements like for example <br>, <div>,
"display:block" break inline-block elements in a way, that these
elements are not inlined at all.

Reproducible: Always

Steps to Reproduce:
1. Place one or more block elements inside an inline-block.

Example code:

<html>
  <body>

    foo:
    <span style="display:inline-block; vertical-align:top">
      bar<br/>
      baz
    </span>
    <br/><br/>

    foo:
    <span style="display:inline-block; vertical-align:top">
      <span style="display:block">bar</span>
      <span style="display:block">baz</span>
    </span>
    <br/><br/>

    foo:
    <span style="display:inline-block; vertical-align:top">
      <div>bar</div>
      <div>baz</div>
    </span>
  </body>
</html>

Actual Results:  
The inline-block is broken. The output of the example source looks like
this:

foo: bar
baz

foo:
bar
baz

foo:
bar
baz


Expected Results:  
The inline-block should be intact in all three cases:

foo: bar
     baz

foo: bar
     baz

foo: bar
     baz
Firefox 2.0 does _not_ support display:inline-block and it displays your sample code accordingly, but not as you expect.
Gecko 1.9a trunk builds (Minefield) do support inline-block and display your sample correctly (fixed in bug 9458).

Or did you mean to file a bug against those trunk builds ?

(btw, your sample code is invalid, a <div> cannot be a descendant of a <span>)
No, I tested with the mentioned Firefox release, not against trunk builds. It was not clear to me that Firefox does not support block-inlines in the latest release.
Sorry for the div-span mixture. It was just a quick test, that rendered as expected in other browsers (test 1-3 tested with Safari and Konqueror, test 2 tested with IE7).

Thanks for your help!
OK then, marking as duplicate of bug 9458.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
v.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.