我可以在< h:graphicImage >的标题中使用html属性吗?
我想要这样的东西:
<h:graphicImage value="/images/box.gif" title="#{literal}"/>其中#{literal}是一个字符串:< b > BoldText < /b >
标题属性可以解释< b>标签吗?
发布于 2014-02-13 21:54:32
因为您是用html标记的,所以我用HTML + CSS回答您。你可以使用CSS为属性设置一些样式。
超文本标记语言代码:
<a href="#" title="This is link">Hi., Buddy.!!</a>CSS代码:
a {
color: #900;
text-decoration: none;
}
a:hover {
color: red;
position: relative;
}
a[title]:hover:after {
content: attr(title);
padding: 4px 8px;
color: #333;
position: absolute;
left: 0;
top: 100%;
white-space: nowrap;
font-weight: bold;
border-radius: 5px;
box-shadow: 0px 0px 4px #222;
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc));
background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc);
background-image: -moz-linear-gradient(top, #eeeeee, #cccccc);
background-image: -ms-linear-gradient(top, #eeeeee, #cccccc);
background-image: -o-linear-gradient(top, #eeeeee, #cccccc);
}JSFIDDLE的演示: http://jsfiddle.net/f29uq/
希望这能有所帮助!
https://stackoverflow.com/questions/21749523
复制相似问题