1

请帮助我只需要 IE 的 wright 风格有没有人知道它也我想要 Firefox 特定的 css,我试图展示这样的东西

在此处输入图像描述

4

3 回答 3

1

对于任何 Mozilla 使用:

@-moz-document url-prefix() 
{ 
  // Styles for mozilla goes here
}

对于特定的 IE,请使用以下内容。这是IE 8

<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="ie8specific.css" />
<![endif]-->

适用于 IE 7 及更低版本

<!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href="ie7-and-down.css" />
<![endif]-->

适用于 IE 7 及更高版本

<!--[if gt IE 6]>
    <link rel="stylesheet" type="text/css" href="ie7-and-up.css" />
<![endif]-->

或者

<!--[if gte IE 7]>
    <link rel="stylesheet" type="text/css" href="ie7-and-up.css" />
<![endif]-->

如果你想对 IE 使用内联 CSS,那么不要链接到 CSS 文件,而是在条件之间添加样式。

<!--[if gte IE 7]>
        <style>
                  // Style for IE 7 and higher versions.
            </style>
<![endif]-->
于 2013-08-30T09:53:36.783 回答
1

在标题中放置类似于以下内容的内容。

<!--[if IE 6]>
Special instructions for IE 6 here
<![endif]-->

这适用于您选择的任何浏览器,请考虑:

<!--[if lt IE 9]>
your css in here
<![endif]-->

如果浏览器是 ie 8 或更低版本,这将显示您指定的规则。

于 2013-08-30T09:41:18.223 回答
0

对于 IE,您可以使用:

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="iespecific.css" />
<![endif]-->

对于 Mozilla,您可以使用:

<style type="text/css">
@-moz-document url-prefix() {
    h1 {
        color: red;
    }
    // all styles for mozilla alone
}
</style>
于 2013-08-30T09:44:57.707 回答