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

  1. <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
  2. xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
  3.  
  4. <!-- Example 1: Specifying a CSS class inline -->
  5. <h:outputStylesheet>
  6. .example-inline {
  7. opacity: .65;
  8. box-shadow: none;
  9. }
  10. </h:outputStylesheet>
  11. <button class="example-inline">
  12. #{i18n['button']}
  13. </button>
  14.  
  15. <!-- Example 2: Specifying a CSS class from a JSF resource -->
  16. <h:outputStylesheet library="css" name="example-resource.css" />
  17. <button class="example-resource">
  18. #{i18n['button']}
  19. </button>
  20.  
  21. </ui:composition>
  1. .example-resource {
  2. display: block;
  3. width: 100%;
  4. }
Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 3.1.1 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20