Browser specific CSS files

S

Smokey Grindle

Is there any way in asp.net 2.0 to say if this specific browser views my
site give them a CSS sheet that is specific for that browser?

like IE6 get its own, FF get its own, IE7 gets the one FF uses... something
like that... this is of course... for browser compatability

btw I am using ASP.NET 2.0's theme system for all my CSS right now...
 
A

Alan Silver

Smokey Grindle said:
Is there any way in asp.net 2.0 to say if this specific browser views my
site give them a CSS sheet that is specific for that browser?

Don't think so. One of the (few) drawbacks to themes is the lack of
control over which stylesheet files are served. Basically, it's all or
nothing.
like IE6 get its own, FF get its own, IE7 gets the one FF uses... something
like that... this is of course... for browser compatability

This is of course, bad CSS design. You should aim for one CSS file for
all browsers. You can include hacks and filters if you need to send
specific CSS to specific browsers, but this is a last resort and should
only be used if you are really, really certain that the effect cannot be
achieved without. It almost always can unless you are doing very
advanced CSS.

HTH
 
M

Martin

Make the text that contains the css filename a generic html control, with
the runat="server" name value pair, so it can be dynamicly set.

You may like to consider browser capability files, and control adapters.

Martin
 
A

Alan Silver

Martin <[email protected]> said:
Make the text that contains the css filename a generic html control, with
the runat="server" name value pair, so it can be dynamicly set.

Why bother, themes do all that for you.
You may like to consider browser capability files, and control adapters.

He would still be better off considering better CSS!! No amount of
hacking is going to cover up for good coding.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top