確切地說,我該怎麼做?嘗試:如何更改<f:facet>標題的顏色?
<f:facet id="form" name="header" class="customHeader">
<h:outputText value="HELLO!"/>
</f:facet>
和我的CSS:
.customHeader th{
background-color: activeborder;
background-image: none;
}
我remebered包括CSS文件到JSF頁面:
<link type="text/css" ref="stylesheet" href="./newcss.css"/>
但沒有結果,我不能改變的頭彩,我只是沒有看到任何改變。任何幫助?
繼承人的生成HTML代碼:
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="j_idt2">
<title>Facelet Title</title>
<link type="text/css"
ref="stylesheet"
href="./newcss.css" />
</head
><body>
<form id="j_idt5"
name="j_idt5"
method="post"
action="/HTableJSF/faces/newjsf.xhtml"
enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt5" value="j_idt5" />
<table style="background-color: black">
<thead>
<tr>
<th colspan="1" scope="colgroup">HELLO!</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="row1">HELLO</span>
</td>
</tr>
</tbody>
</table>
<input type="hidden"
name="javax.faces.ViewState"
id="j_id1:javax.faces.ViewState:0"
value="-3603525257247985306:-5087066467544098625"
autocomplete="off" />
</form>
</body>
</html>
檢查HTML結構。檢查樣式表是否真的包含在內('body {background-color:red;}')。 – 2014-10-08 18:37:10