Safari and Alternative Stylesheets
I have been working on FREE-CMA.net lately, and I have put most of the finishing touches on the site. One of the last pieces of the puzzle that I wanted to complete was a print-media alternative stylesheet. Most modern browsers now honor media="print" stylesheets when printing, and they offer a convenient means to maintain a nice look from screen to paper.
My primary objective in the print.css stylesheet was to ensure that the navigation on the left-hand side of the page was hidden, using display: none; on #navbar. Simple enough, right? Of course, Firefox and Opera understood perfectly and hid the corresponding floated div upon print previewing under OS X. Safari, however, decided to unexpectedly quit. Other sites like Mozilla.org use similar declarations in their print stylesheets.
I messed around with print.css for quite some time yesterday, attempting to pinpoint the cause of the quitting, but found no answers just more confusing facts. Any attempt to alter the display: behaviors of any child element of #navbar causes Safari to quit when printing. I attempted to remove all styling from #navbar and its children elements, but the same effect was observed. I resorted to removing all CSS from print.css with the exception of font styles from the body { } element. No effect on quitting behavior.
Most might have chalked it up to a bug in Safari long ago, but I was curious as to what exactly is causing the problem. I know that if I copy use the exact same CSS code in my default, screen display stylesheet (style.css) to print.css, Safari prints fine. Try as I might, I was unable to locate the particular bit of syntax that was causing Safari issues.
I submitted a question along these lines to the css-dissuss list, and I forgot to change the link to the print-media stylesheet to print.css from test.css after testing. Subsequently, I think I will probably not get a response from the list despite my correction of the error, and I fear reprisal if I were to ask again so quickly. And for the record: yes, I fear the list.
About this entry
You’re currently reading “Safari and Alternative Stylesheets,” an entry on sensory output
- Published:
- 4 years, 4 months ago

No comments
Jump to comment form | comments rss [?] | trackback uri [?]