Usage Note 23628: Can I use my existing CSS with ODS?
You can use your existing CSS with ODS. However,
you probably cannot use it right out of the
box, because ODS carries over the PROC TEMPLATE style elements as the
CSS class names, and the class names will not
match those in your CSS.
For example, much of the ODS HTML output
is tagged with <td>. So the td
properties are applied not just to the table cells but also to
the headers, titles, and footnotes, and so on. See the table
in The STYLESHEET Defaults
to learn which
CSS properties are assigned to the
PROC TEMPLATE style elements.
In order to make your CSS classes match the output's
classes, you must
specify the correct
class name as the argument to the HTMLCLASS= option within the appropriate
of PROC TEMPLATE. Issue similar code for every mismatched
class name in your CSS.
Here is an example: The class .Header1 for example could be a class specified in your existing CSS file to format table headings. But the output generated with SAS uses the class .Header for the table headers. Therefore, the class .Header1 is not used.
Instead, the style element Header from PROC TEMPLATE
is carried over into the default CSS for your ODS output.
Therefore, you must reassign the class .Header to .Header1 by
issuing HTMLCLASS= attribute as follows:
define style styles.test;
style header from header /
ods html file="c:\temp\temp.html" stylesheet=(url="c:\temp\newcss.css");
proc print data=ashelp.class;
ods html close;
can be used in conjunction with an existing CSS.
See Order of Precedence for an explanation of
which style definitions take precedence.
Operating System and Release Information
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
Query and Reporting ==> Creating Reports ==> Stylesheets SAS Reference ==> ODS (Output Delivery System)