What is syntax to add external CSS file to jsf?
Tried both ways.Didn't help.
1.
<head>
<style type="text/css">
@import url("/styles/decoration.css");
</style>
</head>
2.
<head>
<link rel="stylesheet" type="text/css" href="/styles/decoration.css" />
</head>
The updated JSF 2.0 method is a bit tidier. Instead of:
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/css/compass.css"/>
you now do this:
<h:outputStylesheet library="css" name="compass.css"/>
and the stylesheet resource should be placed in resources\css.
Where resources is at the same level as the WEB-INF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With