我有以下代码
Button orderButton = new Button("");
orderButton.setStyleName("OrderButton");
orderButton.getElement().getStyle().setProperty("marginTop", "35px");
CSS 看起来像这样
.OrderButton {
width:208px;
height:43px;
background-image:url('graphics/OrderButton.jpg');border:0;margin:auto;
}
.OrderButton-down {
width:208px;
height:43px;
background-image:url('graphics/OrderButton_down.jpg');border:0;margin:auto;
}
但是点击按钮并没有改变任何东西。样式保持不变,“OrderButton”和“OrderButton-down”被忽略。
我是不是忘记了什么?
最佳答案
您是否尝试过使用常用的 css 标签 active 和 hover?
".OrderButton-down" would then look like this ".OrderButton:active" This way you can also use the :hover tag
关于css - gwt按钮的自定义CSS样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9650016/