如何正确地重新定义 FireFox 的 CSS 设置?
How to correctly redefine the CSS settings for FireFox?
我在使用 CSS 时遇到以下问题。
我必须定义这种样式,只有在使用的浏览器是 **FireFox 时才必须应用)
body {
text-align: center;
background-color: #E9FDE9;
color: #696969;
size: 12px;
}
因此只有当浏览器是 FireFox 时才需要重新定义 body 标签的 CSS 设置。
我知道对于 IE 我可以使用条件注释...但是对于 FireFox?
对于 Chrome Firefox 和 IE
<style type='text/css'>
/*This will work for chrome */
#categoryBackNextButtons
{
width:490px;
}
/*This will work for firefox*/
@-moz-document url-prefix() {
#categoryBackNextButtons{
width:486px;
}
}
</style>
<!--[if IE]>
<style type='text/css'>
/*This will work for IE*/
#categoryBackNextButtons
{
width:486px;
}
</style>
<![endif]-->
这样就可以了:
@-moz-document url-prefix() {
body {
text-align: center;
background-color: #E9FDE9;
color: #696969;
size: 12px;
}
}
我在使用 CSS 时遇到以下问题。
我必须定义这种样式,只有在使用的浏览器是 **FireFox 时才必须应用)
body {
text-align: center;
background-color: #E9FDE9;
color: #696969;
size: 12px;
}
因此只有当浏览器是 FireFox 时才需要重新定义 body 标签的 CSS 设置。
我知道对于 IE 我可以使用条件注释...但是对于 FireFox?
对于 Chrome Firefox 和 IE
<style type='text/css'>
/*This will work for chrome */
#categoryBackNextButtons
{
width:490px;
}
/*This will work for firefox*/
@-moz-document url-prefix() {
#categoryBackNextButtons{
width:486px;
}
}
</style>
<!--[if IE]>
<style type='text/css'>
/*This will work for IE*/
#categoryBackNextButtons
{
width:486px;
}
</style>
<![endif]-->
这样就可以了:
@-moz-document url-prefix() {
body {
text-align: center;
background-color: #E9FDE9;
color: #696969;
size: 12px;
}
}