JSF Showcase

h:outputStylesheet

HtmlOutputStylesheet is a UIOutput component that renders a <style> element.

General Usage

CSS classes can be specified inline or included from external resource files.

Source Code

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

	<!-- Example 1: Specifying a CSS class inline -->
	<h:outputStylesheet>
		.example-inline {
			opacity: .65;
			box-shadow: none;
		}
	</h:outputStylesheet>
	<button class="example-inline">
		#{i18n['button']}
	</button>

	<!-- Example 2: Specifying a CSS class from a JSF resource -->
	<h:outputStylesheet library="css" name="example-resource.css" />
	<button class="example-resource">
		#{i18n['button']}
	</button>

</ui:composition>
.example-resource {
	display: block;
	width: 100%;
}
Liferay Faces Bridge Implementation 4.1.0 + Showcase Common 3.0.1 + Liferay Faces Util 3.1.0 + Mojarra 2.2.14