如何给Internet Explorer不同的CSS行? [英] How to give Internet Explorer different CSS lines?

查看:110
本文介绍了如何给Internet Explorer不同的CSS行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想象一下我有一个 DIV 。我想将它与其他div一起显示,所以我给它 display:inline-block 以及CSS表格中的其他样式定义。



现在,Internet Explorer想要显示: display:inline; 表示我想要的行为。



如何给Internet Explorer一个单独的样式命令覆盖好的浏览器的定义,所以只有IE将有 display:inline; 。由于技术限制,我不能在HTML中使用<![If IE] - > -stuff,我需要保留在CSS文件中。

解决方案

您可以使用如下选择器:



\ 9 - IE8及以下版本, * - IE7及以下版本, _ p>

在您的情况下:

  * display:inline; 

您可以简单地将其添加到css的其余部分:

  div {
display:inline-block;
// some;
// other;
// css;
* display:inline;
}

更新




IE版本5到8.(他们都是
的影响) -
Cobra_Fast 1分钟前


在这种情况下, >

  div {display\9:inline;} 


Imagine I'm having a DIV. I want to display it in a row with other divs, so I'm giving it display: inline-block along with other style definitions in a CSS sheet.

Now Internet Explorer wants to have display: inline; for the behavior I want.

How do I give Internet Explorer a seperate styling command to overwrite the definition for good browsers, so only IE will have display: inline;. Due to technical limitations I cannot use <![If IE] -->-stuff in HTML, I need to stay within the CSS file.

解决方案

You can use selectors like so:

\9 – IE8 and below, * – IE7 and below, _ – IE6

So in your case:

*display: inline;

You can simply add this to the rest of the css:

div{
display: inline-block;
// some;
// other;
// css;
*display: inline;
}

Read my blog post on this.

Update

IE version 5 till 8. (They are all affected) – Cobra_Fast 1 min ago

So in this case, you'd use

div{display\9:inline;}

这篇关于如何给Internet Explorer不同的CSS行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆