GWT IE与FlowPanel的宽度有关

时间:2014-08-06 07:57:26

标签: internet-explorer gwt

我有这段代码:

 private FlowPanel main = new FlowPanel();
 private FlowPanel mainContentPanel = new FlowPanel();
 private HorizontalPanel horizontalFixedPanel = new HorizontalPanel();
 private HorizontalPanel horizontalFlexPanel = new HorizontalPanel();

 mainContentPanel.addStyleName("mainPanel");

 FlowPanel panel = new FlowPanel();
 panel.addStyleName("fixed");
 horizontalFixedPanel.add(panel);

 mainContentPanel.add(horizontalFixedPanel);
 mainContentPanel.add(horizontalFlexPanel);

 main.add(mainContentPanel);

 RootPanel.get().add(main);

style.css:

*.fixed {
    border: 5px solid red;
    padding: 5px;
    width: 800px;
    margin-left: 5px;
}
.mainPanel {
    border: 5px solid black;
    padding: 5px;
    overflow-x: auto;
}

*

当我在Chrome中打开我的应用时,我得到了 - enter image description here 在Internet Explorer中 - enter image description here

为什么IE窗口后面的宽度和滚动出现?我需要像Chrome一样使用主面板。

1 个答案:

答案 0 :(得分:0)

我认为您应该为mainPanel添加一些精确的宽度:

.mainPanel {
    width: 100%;
    // or
    width: 500px;
}