Style sheet support is new to version 1.2 of the Formatting Tools. This support provides increased flexibility for formatting your output by enabling you to take advantage of Cascading Style Sheets (CSS) and JavaScript Style Sheets (JSS). Using style sheets is optional and is recommended only for those users who are familiar with creating and implementing style sheets.
Note: Currently, the HTML Formatting Tools do not support the ID element of style sheets.
Style sheet support allows you to reference up to five style
sheets. Your style sheets can contain any information that
is valid in an HTML file between the begin and end HEAD
tag. You can include the style sheets by linking to them, using
a LINK
tag, or by embedding the text of the style
sheet in the header of your HTML file.
This topic includes
You can choose to use only the link method, only the embed method, or a combination of both methods.
The maximum number of style sheets that you can include is five.
You are responsible for including the style sheets in an appropriate order. The Formatters do not check to ensure that you have all of the required style sheet elements in the referenced style sheet, nor do they validate your style sheet syntax.
Use SSHREFn
to link to a style sheet and either
SSFILEn
or SSFREFn
to embed a style
sheet. n can be 1, 2, 3, 4, or 5. You can use both
the link method and the embed method in one HTML file;
however, you can use each value of n only once.
For example, you may want to link to two style sheets plus provide comment text that accompanies each style sheet. Your Formatter invocation might contain the following:
ssfile1=comments1.txt, sshref2=/style/style1.css, sstype2=text/css, ssrel2=stylesheet, ssfile3=comments2.txt, sshref4=/style/style2.css, sstype4=text/css, ssrel4=stylesheet,
If your style sheet relies on a specific HTML tag, be sure that the tag is applied to the appropriate element in your output.
Applying styles in this manner may require you define specific tags and apply them to elements in your output. Be sure you are familiar with the information discussed in Using Tag Descriptions.
If you are embedding style sheets, be sure to adequately qualify the location of the file so that the formatter can locate the file for inclusion.
If you are linking to a style sheet, be sure that you provide a valid URL for the style sheet.
The style sheet syntax includes arguments that specify
The only arguments defined here are those used to include style sheets in the HTML file. All other arguments are discussed in the syntax sections of each formatter.
When you use the link method, the style sheet is referenced using
a LINK
tag. The line added to your
HTML file might look like the following (assuming that you specified
all of the necessary information):
<LINK HREF="1qtr98.css" TYPE="text/css" REL="stylesheet" MEDIA="screen">
The following define the arguments that you can use with
the link method. Each one of these arguments specify a value
on the LINK
tag. For more information about
linking files using the LINK
tag, refer to your
favorite HTML guide.
Note: Do not include the quotes when you specify a value for the following arguments. The Formatting Tools supply the proper quoting.
sshref1-sshref5=value
LINK HREF
attribute.
You cannot specify SSHREFn
and the
corresponding SSFILEn
or SSFREFn
.
For example, if you use SSHREF1
, you cannot use
SSFILE1
.
sstype1-sstype5=value
text/css
. If you are using JavaScript Style
Sheets, this value is text/javascript
. The supplied value is
used on the TYPE
attribute.
ssrel1-ssrel5=value
stylesheet
. The supplied
value is used on the REL
attribute.
ssrev1-ssrev5=value
REV
attribute.
sstitle1-sstitle5=value
TITLE
attribute.
ssmedia1-ssmedia5=value
MEDIA
attribute.
When you use the embed method, the contents of the file you reference is actually copied into the header of the HTML file. You can use the embed method to include style or scripting information from multiple files into the HTML file created by the Formatter.
ssfile1-ssfile5=value
For example, the first file you embed may contain the
STYLE
tag but it does not end the <STYLE>
tag. The next file you embed may not contain a <STYLE>
tag, but it does contain the end tag, </STYLE>
.
Note: You cannot specify SSFILEn
and the
corresponding SSHREFn
or SSFREFn
.
For example, if you use SSFILE1
, you cannot use
SSHREF1
.
ssfref1-ssfref5=value
For example, the first file you embed may contain the
STYLE
tag but it does not end the <STYLE>
tag. The next file you embed may not contain a <STYLE>
tag, but it does contain the end tag, </STYLE>
.
Note: You cannot specify SSFILEn
and the
corresponding SSHREFn
or SSFREFn
.
For example, if you use SSFILE1
, you cannot use
SSHREF1
.
If you plan to use style sheets for your output, do the following:
If you are including the style sheet files, make sure that you provide the path to files and that the formatter can access the files in the specified location.
If you are linking to the style sheet files, make sure the files can be accessed by the Web server that will serve your final HTML file.
Create the file or files that contain your style information.
Decide if you are going to define custom tags or use the syntax arguments that enable style sheets. (You can use a combination of these two methods.)
Add the necessary syntax for including style sheets to your macro call.
Add the necessary CLASS information for each element of your output that you want to format using style sheets. You do this by adding the necessary syntax to your macro call.
If you created custom tag descriptions, you may not need to perform this step.
Run your SAS program or submit the formatter in batch mode.