如何在 CssResource 中编写组合选择器?
假设我有这样的 css 样式:
.foo a, .foo a:visited .foo a:hover {
/* some styles here */
}
.bar table tr td{
/* other style here */
}
How do I识别它们在 CSS 资源中?具体来说,我应该在自己的 CssResource 接口中引用什么样式名称?
Suppose I have a css style like this:
.foo a, .foo a:visited .foo a:hover {
/* some styles here */
}
.bar table tr td{
/* other style here */
}
How do I identify them them in CSS resource? Specifically, what style name should I refer to in my own CssResource interface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是为什么您想要参考它们? :)
CssResource
只是引用被 GWT 编译器混淆的样式名称的一种便捷方式。因此,您可以将String foo()
和String bar()
放入其中,以便可以将这些样式添加到 Java 代码中的 Widget。现在,假设您在 Widget 中放置了一个应用了.bar
样式的表格 -.bar table tr td
会自动应用于该表格的每个单元格(如按照通常的 CSS 规则),您不需要添加任何其他样式名称等,因此无需像 < 所需的那样直接引用 (.bar table tr td
) 样式code>.bar 单独样式。希望这是有道理的:)
The question is why would you want to refer to them? :) The
CssResource
is just a convenient way of referring to style names that get obfuscated by the GWT compiler. So, you'd putString foo()
andString bar()
in it, so that you could add those styles to your Widgets in your Java code. Now, say, you put a table in your Widget that has the.bar
style applied - the.bar table tr td
gets automagically applied to every cell of that table (as per usual CSS rules), you don't need to add any other style names, etc. so there's no need to refer to that (.bar table tr td
) style directly like it's needed for the.bar
style alone.Hope that made sense :)