2013-11-01 37 views
1

我想了解這樣做的原因。ExtJS 4.2:當layout = auto時,在span標籤內的div

<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選擇這樣做他們的佈局

我看不到裏面的div跨度在其它佈局等佈局=容器內聯元素在這些問題進行了討論(以及更多)內

塊元素 -

can tags have any type of tags inside them?

Is putting a div inside an anchor ever correct?

回答

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.