1

我试图了解这样做背后的原因。

<fieldset id="fieldset-1015" class="x-fieldset x-fieldset-with-title x-fieldset-with-header x-fieldset-default" style="border-width:0;">
    <legend id="fieldset-1015-legend" class="x-fieldset-header x-fieldset-header-default">
    <div id="fieldset-1015-body" class="x-fieldset-body ">
        <span id="fieldset-1015-outerCt" style="display: table; width: 100%; table-layout: fixed;">
            <div id="fieldset-1015-innerCt" class="" style="display:table-cell;height:100%;vertical-align:top;">
            </div>
        </span>
    </div>
</fieldset>

我知道这是一个非常有争议的问题。但我想了解为什么 ExtJS 为他们的布局选择这样做

我在其他布局(如 layout=container)中看不到跨度内的 div

这些问题(以及更多问题)中讨论了内联元素内的块元素 -

标签里面可以有任何类型的标签吗?

将 div 放入锚内是否正确?

4

1 回答 1

2

您的问题的答案在代码中的注释中(来源:http ://cdn.sencha.io/ext-4.2.0-gpl/ext-all-debug-w-comments.js ):

// All browsers that support display:table use this template.
// An outerCt with display:table shrink-wraps contents, and contains child
// margins. The table-cell innerCt is required in order to support percentage
// heights on child elements. Originally the outerCt started out as a div, but
// was changed to a span to work around an obscure firefox 3.6 bug where
// placing a Container inside of a fieldset's legend element causes the legend
// to blow up if the outerCt is a div.
于 2013-11-02T18:50:38.983 回答