The SAS Output Delivery System and reporting techniques

CSS files

Reply
Occasional Contributor
Posts: 8

CSS files

Hi,

I'm playing around with ODS and CSS files for the first time. I'm creating a .css file with a plan to eventually modify it slightly and then use it with other programs. However, when I use what I create I don't get the same html file.

Here is the code:

/* create CSS */
ods html path='c:\temp\' (url=none)
file ='styleBrown.html'
style=brown
stylesheet="brown.css";
proc print data=sashelp.class(obs=3);
title "1) creating and using a css file";
run;
ods html close;

/* use CSS */
ods html path='c:\temp\' (url=none)
file ='styleBrown2.html'
stylesheet=(url="brown.css");
proc print data=sashelp.class(obs=3);
title "1) creating and using a css file";
run;
ods html close;

Since I don't want to post all the html code from both files. Here are the comparisons between the two lines that are different in the files.

Compare: (<)C:\temp\styleBrown.html (2648 bytes)
with: (>)C:\temp\styleBrown2.html (2607 bytes)

49c49
<
---
>


56c56
<

---
>


What can I do to get the 2nd file to look like the 1st one? (Note: I tried to bold the differences in the two lines, but then I lost the ends of the lines)

I'm using SAS 9.2 TS Level 2M0 on WinXP.

Thanks.
SAS Employee
Posts: 16

Re: CSS files

The issue that you are running into here is a problem with mixing HTML attributes and CSS properties. When you run your second HTML job you are implicitly using styles.default as the style. This style has attributes in it that will affect the HTML attributes on the table element in the output document. In order for the HTML to match up, you will have to specify style=brown on the second ODS HTML statement.

We are currently working on better support for CSS that will hopefully eliminate this CSS/HTML dichotomy; however, not all current browsers support enough features of CSS to entirely mimic everything that you can do with HTML attributes on tables.
Occasional Contributor
Posts: 8

Re: CSS files

Posted in reply to Kevin_SAS
Thanks, Kevin. I'll try putting that in. At least I know it's not me. :-)
Ask a Question
Discussion stats
  • 2 replies
  • 148 views
  • 0 likes
  • 2 in conversation