June 24th, 2008
Easy to Learn Cascading Style Sheets - Part X
CSS And Printing Tools
There are several tools supporting CSS, whose sole purpose is to convert HTML or XML documents, styled with CSS, into printed documents. These could either print directly, or convert the document into a more printer orientated format, such as PostScript or PDF.
Most of these tools offer lower CSS support than normal browsers, many even lower than the CSS support of Internet Explorer, and in most cases, a better result could be obtained by printing from a browser. Examples of these tools would be HTML2PS or DOMPDF.
Download Link: HTMP2PS
Download Link: DOMPDF
There is one exception to this; a program called Prince. It is the only such tool that has better CSS support than most browsers. In fact, its CSS 2.1 print media support is equivalent to Opera’s, with several extras from the CSS 3 Generated Content for Print Media module that no browser is capable of supporting.
CSS And Common Browser Problems
Browsers support varying amounts of CSS. Support generally increases as new versions are released.
For old browsers, most CSS problems are noticed in Netscape 4. I have found a
site that fully documents every bug that Netscape 4 has with stylesheets. It is a very long article. Generally, I recommend that you ignore Netscape 4, and style for newer browsers instead (Netscape itself is now using version 8). If you need to ensure that Netscape 4 can still view your pages (you don’t), it is best to simply put all of your styles in another external file, and use the @import rule to import it, since Netscape 4 cannot import. Netscape 4 will show an unstyled page.
Out of all the current browsers, Internet Explorer’s support is generally the worst. It is missing many parts of CSS, and can be a very difficult browser to design for. Most sites will need to cater for older versions of Internet Explorer (the Windows version, at least - the Mac version is very different, with very different problems). This means restricting styles to CSS 1, and the basics of CSS 2 positioning. If you want to use more advanced styles, you need to make sure that these are purely decorative, and the style still works in Internet Explorer.
In general, the best way to write is using a browser with a high level of CSS support to check your CSS, then after you have something that works nicely, work out what you will have to change to make it work in Internet Explorer. For development, I recommend testing in at least Opera and Mozilla/Firefox (both are available on all major platforms). You may also want to test in Konqueror or Safari, and maybe even iCab 3 if you have access to them.
Remember that there is usually more than one way to achieve what you need, such as being able to use both float and position to do columns (you can also use display:table; in most browsers, but not Internet Explorer).

