Html h:图形图像标题-格式化文本
我可以在Html h:图形图像标题-格式化文本,html,jsf,jsf-2,Html,Jsf,Jsf 2,我可以在的标题中使用html属性吗 我想要一些像: <h:graphicImage value="/images/box.gif" title="#{literal}"/> 其中,{literal}是一个字符串:粗体文本 title属性可以解释标记吗?既然您是用html标记的,我在html+CSS中回答您。您可以使用CSS为属性设置一些样式 Html代码: <a href="#" title="This is link">Hi., Buddy.!!</a>
<h:graphicImage value="/images/box.gif" title="#{literal}"/>
其中,{literal}
是一个字符串:粗体文本
title属性可以解释
标记吗?既然您是用html标记的,我在html+CSS
中回答您。您可以使用CSS为属性设置一些样式
Html代码:
<a href="#" title="This is link">Hi., Buddy.!!</a>
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);
}
JSFIDLE中的演示:
希望这有帮助 如果我只希望字符串中的一个单词是粗体的怎么办?例如:#{literal}=“这是一个粗体文本”