我正在尝试向 GWT g:label 添加第二种样式。我将 CSS 样式定义为 CssResource。标签可以很好地拾取 .gwt-Label 样式,但它没有拾取添加样式中定义的字体颜色的变化。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
xmlns:g='urn:import:com.google.gwt.user.client.ui'>
<ui:with field='res' type='com.me.area.workflow.portal.flip.client.ui.Resources' />
<g:DockLayoutPanel unit='PCT'>
<g:west size="50">
<g:Label addStyleNames="{.navPanelText}">Flip Workflows</g:Label>
</g:west>
</g:DockLayoutPanel>
</ui:UiBinder>
和 CSS
.gwt-Label {
font: bold 16px "Lucida Grande", Geneva, Verdana, sans-serif;
vertical-align: middle;
margin-left: 10px;
margin-right: 10px;
margin-top: 10px;
text-decoration: none;
padding: 3px 5px 3px 5px;
}
.navPanelText {
color: white;
}