CSS with if/then browser logic

2019-02-14 03:48发布

For browsers < IE7, I want to use a certain style attribute, while for other browsers I'd like to use another. Can I do this using a single css file, or do I have to do if then logic to include an ie hack css file?

7条回答
Root(大扎)
2楼-- · 2019-02-14 04:50

Well you could use javascript to detect the browser and apply a class based on that. For example, see:

JQuery Attributes

查看更多
登录 后发表回答