仅适用于IE 8的CSS
问题描述:
我只需要为IE 8设置某些样式。
I need to style some items for only IE 8. If I do this:
<!--[if IE 8]><link rel="stylesheet" href="mystyleIE8.css" type="text/css" media="screen, projection"/><![endif]-->
然后我这样做:
<!--[if IE 7]><link rel="stylesheet" href="myStyleIE7.css" type="text/css" media="screen, projection"/><![endif]-->
会发生什么?我发现此链接到先前的SO问题,这暗示着<!-[如果IE 8]>
表示如果IE 8或更低版本。这是否意味着使用<!-[如果IE 8]>
将覆盖所有<!-[如果IE 7]> ;
css?我的程序是否知道仅对IE 8使用<!-[如果IE 8]>
和<!-[如果IE 7]>
for IE 7?
What will happen? I found this link to a previous SO question which implied that <!--[if IE 8]>
means "If IE 8 or lower". Does this mean that using <!--[if IE 8]>
will overwrite all <!--[if IE 7]>
css? Will my program know to use <!--[if IE 8]>
for only IE 8 and <!--[if IE 7]>
for IE 7?
答
这并不表示如果IE 8或更低版本
It does not mean "If IE 8 or lower".
<!--[if IE 8]>
表示是否为IE8
<!--[if lt IE 8]>
如果小于IE 8
<!--[if lte IE 8]>
如果小于或等于IE 8
If it is less than or equal to IE 8