开发者

How to make a value of <h:outputText> bold?

开发者 https://www.devze.com 2022-12-17 05:38 出处:网络
I have the following code: <h:outputText id=\"dateVal\" value=\"#{items.date}\"> <f:convertDateTime pattern=\"MMM-yy\" />

I have the following code:

<h:outputText id="dateVal" value="#{items.date}">  
<f:convertDateTime pattern="MMM-yy" />    
</h:outputText> 

How can I 开发者_JAVA百科display the value #{items.date} in bold?


Just do:

<h:outputText value="AAAAA" style="font-weight:bold"/>

and this code will output the following html:

<span style="font-weight:bold">AAAAA</span>


How about enclosing it in a span to make it bold or adding a css style and applying it.

<span style="font-weight:bold">My Value Bold!</span>

or rather

<h:outputText value="AAAAAAA" style="font-weight:bold" />


You should use styleClass rather than style for easier change and maintenance

 <h:outputText value="#{bundle.Label_place}" styleClass="recordLabel"/>

with a style defined in a shared style sheet you can use everywhere

.recordLabel {
    font-weight:bold;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消