#43 CSS Stylesheets, Part I (stylesheet.rcss)

Having .rhtml files is great—they allow you to dynamically generate whatever visible HTML you want. But you can use mod_ruby for more than that. A major portion of any well-designed modern website will be its stylesheets. One of the frustrations that web designers have to deal with is incomplete or incompatible CSS support among the various browsers. There are lots of potential solutions for those frustrations, which you can find at sites like http://www.richinstyle.com or http://alistapart.com. One obvious solution for programmers is to determine exactly which browser someone is using (via ENV[‘USER_AGENT’]) and serve that user a stylesheet customized for his or her specific browser.

That’s a great ...

Get Ruby by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.