javascript - ExtJS 4.2 : Div inside span tag when layout=auto

标签 javascript extjs extjs4.2

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

<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 等其他布局中看不到 span 内的 div

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

can tags have any type of tags inside them?

Is putting a div inside an anchor ever correct?

最佳答案

您问题的答案在代码的注释中(来源: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.

关于javascript - ExtJS 4.2 : Div inside span tag when layout=auto,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19734354/

相关文章:

javascript - 组合框使用箭头键滚动页面 ExtJs

extjs - 带有缓冲存储的缓冲(无限)网格不会在存储重新加载时更新

extjs4.2 - ExtJs 4.2 数据存储加载事件

javascript - 在backbone.js中切换 View 时检查未保存的更改

javascript - 在c3js中的折线图上绘制趋势线

javascript - HighCharts - 从所需点添加垂直线

javascript - 页面淡入和淡出过渡

javascript - 为面板创建负载蒙版

javascript - ext js行扩展器日期格式渲染

extjs - 学习 ExtJS4