You can set CSS style sheets either by referencing them in your document, setting or adding them using a configuration property, or inline in your document.

Defining a CSS style sheet in the "style" Section of the Document:

<head><style type="text/css">p { color: red; }</style></head>


Referencing an external CSS style sheet using the <link> Element:

<link href="https://someServer/css/layout.css" rel="stylesheet" type="text/css" />


Defining CSS Styles Inline:

<table style="color: red">...</table>


Adding a CSS style sheet using a configuration property:


Java:

config.setUserStyleSheets(new Resource().setUri("https://server/layout.css"));

PHP:

$config["userStyleSheets"] = array(array("uri" => "https://server/layout.css"));

.NET:

config.UserStyleSheets.Add(new Resource { Uri = "https://server/layout.css" });

CLI:

--userStyleSheets "" "https://server/layout.css"



Java:

config.setUserStyleSheets(new Resource().setContent("p { color: red }"));

PHP:

$config["userStyleSheet"] = array(array("content" => "p { color: red }"));

.NET:

config.UserStyleSheets.Add(new Resource { Content = "p { color: red }" });

CLI:

--userStyleSheets "p { color: red }" ""


XSLT style sheets can be set either using a configuration property, or by referencing them in the document. They cannot be specified directly inline as CSS style sheets can be.



Note:

XSLT style sheets are applied in a preprocessing step, before the document is laid out and CSS or JavaScript is processed.


Adding an XSLT style sheet using a configuration property:


Java:

config.setXsltStyleSheets(new Resource().setUri("style.xsl"));

PHP:

$config["xsltStyleSheets"] = array(array("uri" => "style.xsl"));

.NET:

config.XsltStyleSheets.Add(new Resource { Content = "style.xsl" });

CLI:

--xsltStyleSheets "" "file:///C:/xsl-style.xsl"



Referencing an external XSLT style sheet via the <link> element:


<link href="wizardOfOz.css" type="text/css" rel="stylesheet"/>