[英]How can I use css for Vaadin 7 components?
I've set the styleName for my component, but it doesn't appear to have any effect: 我已经为我的组件设置了styleName,但是似乎没有任何效果:
Label label=new Label("this is test");
label.setStyleName("mytheme");
My CSS: 我的CSS:
@import "../reindeer/styles.css";
.test{
color: cornflowerblue;
}
.mytheme {
font-family: 'Cabin Sketch';
font-size: 24px;
font-weight: bold;
padding-top: 10px;
padding-left: 10px;
line-height: 30px;
}
.v-label {
background: cyan;
}
My directory in intellij IDE: web/VAADIN/themes/mytheme
我在intellij IDE中的目录:
web/VAADIN/themes/mytheme
I've already seen this question , but the solution doesn't work for me. 我已经看到了这个问题 ,但是该解决方案对我不起作用。
input in main class: @Theme("mytheme") 在主类中输入:@Theme(“ mytheme”)
and use in all project by component.setStyleName("Logo");
并在所有项目中使用
component.setStyleName("Logo");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.