针对不同浏览器chrome& amp;的有条件内联CSS火狐

时间:2013-01-14 09:14:30

标签: css

我为div定位编写了一个css。 这是css

background-color: white; 
border-style: outset; 
margin: 115px 0px 0px -40px;

当我在firefox中看到输出时,div位置没问题,但是当我在chrome中看到这个时,输出因margin: 145px 0px 0px -40px;

而变形

的镀铬余量应为margin: 115px 0px 0px -40px;

所以我搜索谷歌并找到一个片段,我申请了但没有工作。

style="width:310;height:402;background-color:white;border-style:outset; if webkit (margin:115px 0 0 -40px) else  (margin:146px 0 0 -40px);"

那么请指导我如何为chrome编写条件内联css ...任何想法。感谢

1 个答案:

答案 0 :(得分:1)

我写了一个测试页面,没找到你说的这种情况。 也许你写一个测试页面。 严格来说,firefox chrome是现代浏览器的标准,不应该有这种情况。

*{ margin:0; padding:0;}
body{font:12px/1.5 arial;background:#fff;}
.test{background-color: white; border-style: outset; margin: 115px 0px 0px -40px;}

<div class="test"></div>

demo here