Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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
Css 如何在GWT中设置锚定样式?_Css_Gwt_Anchor - Fatal编程技术网

Css 如何在GWT中设置锚定样式?

Css 如何在GWT中设置锚定样式?,css,gwt,anchor,Css,Gwt,Anchor,如何使用UIBinder为GWT中的锚添加样式?我在UiBinder模板XML中有以下代码: <g:Anchor ui:field="forgotPassLink">Forgot password?</g:Anchor> 我必须在Anchor上使用BlurEvent和FocusEvent处理程序来处理这个问题吗?如果是这样…那就是样板代码。使用与gwt锚定相同的CSS伪类类: .gwt-Anchor:link {color:#FF0000;} .gwt-Anchor:v

如何使用UIBinder为GWT中的锚添加样式?我在UiBinder模板XML中有以下代码:

<g:Anchor ui:field="forgotPassLink">Forgot password?</g:Anchor>

我必须在Anchor上使用BlurEvent和FocusEvent处理程序来处理这个问题吗?如果是这样…那就是样板代码。

使用与
gwt锚定相同的CSS伪类
类:

.gwt-Anchor:link {color:#FF0000;}
.gwt-Anchor:visited {color:#00FF00;}
.gwt-Anchor:hover {color:#FF00FF;}
.gwt-Anchor:active {color:#0000FF;}
您也可以使用
a.gwt-Anchor
,但这并不是绝对必要的。

这是否有效(使用UIBinder样式名称)


.a:链接{color:#FF0000;}
.a:访问{颜色:#00FF00;}
.a:悬停{color:#FF00FF;}
.a:活动{color:#000FF;}
忘记密码了?

如果您将uibinder与gwt超链接一起使用,可以这样做:

<ui:style>
.mystyle a:link {
color:#3F3F3F; 
text-decoration:none;
}   
</ui:style>

<g:FlowPanel>
    <g:Hyperlink styleName='{style.mystyle}'/>
</g:FlowPanel>
<ui:style>
  .menuItem a:link {color: white;}
  .menuItem a:visited {color: white;}
  .menuItem a:hover {color: white;}
  .menuItem a:active {color: white;}
</ui:style>
<g:Hyperlink styleName="{style.menuItem}" targetHistoryToken="home">Home</g:Hyperlink>

.我的风格a:链接{
颜色:#3f3f;
文字装饰:无;
}   

如下定义您的风格:

<ui:style>
.mystyle a:link {
color:#3F3F3F; 
text-decoration:none;
}   
</ui:style>

<g:FlowPanel>
    <g:Hyperlink styleName='{style.mystyle}'/>
</g:FlowPanel>
<ui:style>
  .menuItem a:link {color: white;}
  .menuItem a:visited {color: white;}
  .menuItem a:hover {color: white;}
  .menuItem a:active {color: white;}
</ui:style>
<g:Hyperlink styleName="{style.menuItem}" targetHistoryToken="home">Home</g:Hyperlink>

.menuItem a:link{color:white;}
.menuItem a:已访问{颜色:白色;}
.menuItem a:悬停{颜色:白色;}
.menuItem a:活动{颜色:白色;}
然后像这样使用它:

<ui:style>
.mystyle a:link {
color:#3F3F3F; 
text-decoration:none;
}   
</ui:style>

<g:FlowPanel>
    <g:Hyperlink styleName='{style.mystyle}'/>
</g:FlowPanel>
<ui:style>
  .menuItem a:link {color: white;}
  .menuItem a:visited {color: white;}
  .menuItem a:hover {color: white;}
  .menuItem a:active {color: white;}
</ui:style>
<g:Hyperlink styleName="{style.menuItem}" targetHistoryToken="home">Home</g:Hyperlink>
主页

别忘了设置
锚定
href属性,至少类似于
'javascript:;'href
属性)。