What is the preferred way of loading browser-specific CSS files?
- by Yuval A
What is the best way to handle browser-specific CSS file loading? Assume you are running in the context of a proper MVC framework.
Here are some options, you are free to discuss the pros and cons of these options as well as any other methods you know of, and prefer:
Server-side solution: use the controller (e.g. servlet) to analyze the user-agent header in the request and return the proper CSS file in the view.
Use browser specific hacks to load files, such as: <!--[if IE]> ... <![endif]-->
Load CSS files asynchronously in client side by inspecting user-agent and adding respective files
Use a client side framework to handle browser-specifics (such as jQuery browser-specific css rules)