我正在使用dojo ContentPane來渲染一個openlayers地圖。當DOM準備就緒並且插入地圖時,dijit的格式將被覆蓋。我已經嘗試通過類和id在CSS中指定高度和寬度,並且也在我的html中內聯。Dojo data-dojo-props樣式被覆蓋
我的HTML:
<div id="map-id"
class="centerPanel"
data-dojo-type="dijit.layout.ContentPane"
data-dojo-props="region: 'center', style: 'width: 1468px;'">
</div>
我的CSS:
#map-id {
width: 1468px;
height: 471px;
}
.centerPanel {
width: 1468px;
height: 471px;
}
我從螢火蟲實際的HTML:
<div id="map-id" class="centerPanel dijitContentPane dijitBorderContainer-child dijitBorderContainer-dijitContentPane dijitBorderContainerPane dijitAlignCenter olMap" data-dojo-props="region: 'center', style: 'width: 1468px;'" data-dojo-type="dijit.layout.ContentPane" title="" role="group" dir="ltr" style="width: 1455px; left: 252px; top: 48px; right: auto; bottom: auto; height: 456px;" widgetid="map-id">
正如你可以看到我的數據道場道具造型ignorded並且新的高度和寬度被插入...任何想法?
聽起來好像你的ContentPane在BorderContainer內部,在這種情況下,父級佈局部件(BorderContainer)很可能指定了子級ContentPane的大小。也許提供一個更完整的例子來說明你想要做什麼會讓我們有更多的工作來幫助。 –