Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gwt CSS类定义没有';不要在内部工作<;g:HTML>;要素_Gwt_Gwt2_Uibinder - Fatal编程技术网

Gwt CSS类定义没有';不要在内部工作<;g:HTML>;要素

Gwt CSS类定义没有';不要在内部工作<;g:HTML>;要素,gwt,gwt2,uibinder,Gwt,Gwt2,Uibinder,你们能告诉我为什么css类定义在下面的例子中不起作用吗 我使用的是GWT2.4+Chrome17 <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui'> <ui:style> div.test { color: red; }

你们能告诉我为什么css类定义在下面的例子中不起作用吗

我使用的是GWT2.4+Chrome17

<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
             xmlns:g='urn:import:com.google.gwt.user.client.ui'>
    <ui:style>
        div.test {
            color: red;
        }
    </ui:style>
    <g:HTML>
        <div class="test">I should be red but I'm not</div>
    </g:HTML>
</ui:UiBinder>

分区测试{
颜色:红色;
}
我应该是红色的,但我不是

中列出的CSS类将被混淆,从
test
GKYSKJX
(或类似内容)

将您的div更新为:

<div class="{style.test}">Now I'm red :)</div>
除非你有充分的理由,否则我建议你坚持第一种方法

更多信息请访问

@external .test;
div.test {
    color: red;
}