Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在GWT中使用CSS格式化ScrollPanel?_Css_Gwt_Gwtp - Fatal编程技术网

如何在GWT中使用CSS格式化ScrollPanel?

如何在GWT中使用CSS格式化ScrollPanel?,css,gwt,gwtp,Css,Gwt,Gwtp,在我的Test.ui.xml中 <g:ScrollPanel height="200px" addStyleNames="{res.css.scrollPanel}"> some widget here</g:ScrollPanel> 它在IE中工作得很好,但在Firefox+Chrome中却不行?为什么? 有趣的是,在Gwt代码中,我们为ScrollPanel设置了背景或颜色 ScrollPanel sp=new ScrollPanel(); sp.g

在我的Test.ui.xml中

<g:ScrollPanel height="200px" addStyleNames="{res.css.scrollPanel}"> some widget here</g:ScrollPanel>
它在IE中工作得很好,但在Firefox+Chrome中却不行?为什么?

有趣的是,在Gwt代码中,我们为ScrollPanel设置了背景或颜色

    ScrollPanel sp=new ScrollPanel();
    sp.getElement().getStyle().setBackgroundColor("orange");
所以,必须有一种方法在Css中为ScrollPanel设置背景,对吗

似乎只有IE支持滚动条格式,Chrome和Firefox不支持


那么,如何在GWT中使用CSS设置ScrollPanel的格式,这在所有浏览器中都适用?

我刚刚检查过,下面的内容在chrome中非常适用

ScrollPanel scrollable = new ScrollPanel();
scrollable.getElement().getStyle().setBackgroundColor("orange");
将以下内容放在UiBinder文件的css中也适用于我:

<ui:style>
.scrollable {
background-color:pink;
}
</ui:style>
你确定滚动面板内的小部件没有占据整个面板,而你看到了吗?如果你用任何其他背景色填充它,橙色会在它后面消失

类似的内容在webkit浏览器上放置了一个滚动条:

::-webkit-scrollbar {
height: 12px;
width: 12px;
background: blue;
}
::-webkit-scrollbar-thumb {
background: red;
-webkit-border-radius: 1ex;
-webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.75); 
}
::-webkit-scrollbar-corner {
background: blue;
}

(摘自,我刚刚用GWT ScrollPanel对其进行了测试)

我刚刚进行了检查,以下内容在chrome中对我来说效果良好

ScrollPanel scrollable = new ScrollPanel();
scrollable.getElement().getStyle().setBackgroundColor("orange");
将以下内容放在UiBinder文件的css中也适用于我:

<ui:style>
.scrollable {
background-color:pink;
}
</ui:style>
你确定滚动面板内的小部件没有占据整个面板,而你看到了吗?如果你用任何其他背景色填充它,橙色会在它后面消失

类似的内容在webkit浏览器上放置了一个滚动条:

::-webkit-scrollbar {
height: 12px;
width: 12px;
background: blue;
}
::-webkit-scrollbar-thumb {
background: red;
-webkit-border-radius: 1ex;
-webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.75); 
}
::-webkit-scrollbar-corner {
background: blue;
}

(摘自,我刚刚用GWT ScrollPanel对其进行了测试)

可以工作,但滚动条不行。我希望滚动条变成蓝色。我编辑了上面的示例,展示了如何设计那些可以正常工作但不能显示滚动条的滚动条。我希望滚动条变成蓝色。我已经编辑了上面的示例来展示如何设置这些滚动条的样式