Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这里展示了如何在 CamelCase 中使用样式,但是如何使用名称中带有破折号的样式?有效的 Java 方法名称中不能有破折号(至少 eclipse 显示语法错误)。
模板中定义的样式:
.menu-inactive{ background-color: grey; }
您可以使用CssResource.ClassName作为无效 Java 标识符的有效 CSS 类名。
CssResource.ClassName
interface MyCssResource extends CssResource { @CssResource.ClassName("menu-inactive") String menuInactive(); }