O'Reilly logo

Ruby by Example by Kevin C. Baird

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

#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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required