I am currently diving into the world of JSF and facing an issue with moving my inline styles to a CSS file. Despite my efforts, I can't seem to get it to work as expected. Below is the code snippet for reference.
The location of my XHTML file is as follows:
\WebContent\template\
And the CSS file resides here:
\WebContent\resources\css\
Here is a snippet of the XHTML code:
<ui:composition template="/template/BasicTemplate.xhtml">
<h:outputStylesheet library="css" name="style.css" />
<ui:define name="content">
<h:form>
dfdskdksdk <h:outputText value="#{msg['message.test1']}" />
<table width="80%">
<tr>
<h:outputStylesheet library="css" name="css/style.css" />
<td width="15%" background="red" >
<b>Location Coverage*</b>
</td>
I have experimented with different combinations like:
<h:outputStylesheet library="css" name="css/style.css" />
<h:outputStylesheet library="css" name="style.css" />
<h:outputStylesheet library="css" name="/resources/css/style.css" />
<h:outputStylesheet library="css" name="resources/css/style.css" />
I've tried placing this line both inside and outside the <ui:composition>
tag but still no luck.
Any insights or solutions would be greatly appreciated!