Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.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
Html h:图形图像标题-格式化文本_Html_Jsf_Jsf 2 - Fatal编程技术网

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>

我可以在的标题中使用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>
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}=“这是一个粗体文本”