Max*_*imG 2 css jsf primefaces
我有问题<p:commandLink>.我想制作悬停效果,但我无法<p:graphicImage>通过CSS 加载图像.
CSS:
.accountEditBtn {
background-image:
url('#{request.contextPath}/resources/image/pencil_black.png');
}
Run Code Online (Sandbox Code Playgroud)
JSF:
<p:commandLink
update="@form"
actionListener="#{someBean.someListener}">
<h:graphicImage styleClass="accountEditBtn" />
</p:commandLink>
Run Code Online (Sandbox Code Playgroud)
我看到带边框的空矩形.
但是当我将alt添加到graphicImage时,我从alt上获取文本图像...
我的错误在哪里?谢谢.ps输入错误 - classType - > styleClass
尝试使用styleClass而不是 <h:graphicImage>
<p:commandLink
styleClass="accountEditBtn"
update="@form"
actionListener="#{someBean.someListener}"/>
Run Code Online (Sandbox Code Playgroud)
试试这堂课
.accountEditBtn { background-image: url('../resources/image/pencil_black.png'); }
Run Code Online (Sandbox Code Playgroud)
BTW
是不应该是图像?或者是图像(文件夹名称)
看看这个..如果你想要commandButton与图像:PrimeFaces图标