I would like to design the css file for one website, here some of the property of css will work in IE but not in firebox so that If any thing is not working in all browser need to write different classes based on the browser this class will apply automatically
how can I do that ?
Can we check the browser and version in css file? if so how do we do that?
i guess, i prefer writing different style sheets for different browsers is good.
and when the request comes from the browser, we do the browser testing and send our css files.
It can be done in many ways. usually, after detecting browser (Request.UserAgent), using different layout pages is one way. so __viewstart file's content is dynamic depending on the browser.
another way is to Render a partial view that takes care of adding css styles to response.
Mayil_Gilli
Member
149 Points
213 Posts
How to write CSS for Different browser?
Apr 28, 2012 06:21 AM|LINK
Hi,
I would like to design the css file for one website, here some of the property of css will work in IE but not in firebox so that If any thing is not working in all browser need to write different classes based on the browser this class will apply automatically how can I do that ?
Can we check the browser and version in css file? if so how do we do that?
roopeshreddy
All-Star
20155 Points
3328 Posts
Re: How to write CSS for Different browser?
Apr 28, 2012 06:36 AM|LINK
Hi,
I think you have already asked this question!
I just wanna add some more information to it!
You can use CSS Media Queries!
http://css-tricks.com/css-media-queries/
http://cssmediaqueries.com/
http://www.w3.org/TR/css3-mediaqueries/
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
IgorKitsula
Member
144 Points
33 Posts
Re: How to write CSS for Different browser?
Apr 28, 2012 06:45 AM|LINK
if you put * before class name or CSS parameter it will will be applyed only in IE. Example:
* html .clearfix { height: 1%; }or
.clearfix { height: 0; *height: 1%; }- Igor
Weblog: http://kitsula.com
riak
Member
268 Points
88 Posts
Re: How to write CSS for Different browser?
Apr 28, 2012 09:08 AM|LINK
You can use IE only comments to target IE
Targets all IE browsers
Targets everything Except IE
IE 7 only
IE 6 only
Hope that helps
sean freeman
Member
170 Points
96 Posts
Re: How to write CSS for Different browser?
Apr 28, 2012 07:41 PM|LINK
i guess, i prefer writing different style sheets for different browsers is good.
and when the request comes from the browser, we do the browser testing and send our css files.
It can be done in many ways. usually, after detecting browser (Request.UserAgent), using different layout pages is one way. so __viewstart file's content is dynamic depending on the browser.
another way is to Render a partial view that takes care of adding css styles to response.
A1ien51
All-Star
29935 Points
5821 Posts
Re: How to write CSS for Different browser?
Apr 29, 2012 06:09 PM|LINK
That is not EVERY version of IE
Eric