我在页面上有一个div,其他浏览器上的按钮整齐地放置,但在铬上,他们正在倒下。 我知道IE 7的显式攻击就像* Margin,但不知道chrome.Is有一种方法可以在css中定义。 我不想要条件语句来解决这个问题。我需要明确地提到铬的负像素边缘以拉动按钮。明确定义在铬边框
Q
明确定义在铬边框
0
A
回答
0
这个jQuery应该将class =“chrome”添加到文档的html元素中。
$(document).ready(function(){
if (navigator.userAgent.indexOf('Mac OS X') != -1) {
if (/chrome/.test(navigator.userAgent.toLowerCase())) { $('html').addClass('chrome'); }
} else {
if (/chrome/.test(navigator.userAgent.toLowerCase())) { $('html').addClass('chrome'); }
}
});
然后,您可以针对DIV像这样:
.div {
margin-bottom: 10px;
}
html.chrome .div {
margin-bottom: 20px;
}
+0
感谢这位队友......但我不得不这样做只是用CSS ...请看下面看看是什么让它在CSS中工作。 – sam
0
这个工作就像一个魅力
@media screen and (-webkit-min-device-pixel-ratio:0) {
/* Safari and Chrome */
.act .now {
margin: -14% auto 0px;
}
/* Safari only override */
::i-block-chrome,.act .now {
margin: 5% auto 0px;
}}
相关问题
- 1. 镀铬边框问题
- 2. 铬中的边框渐变
- 3. 像素边框显示在铬
- 4. 圆形边框不能在铬工作
- 5. 边框颜色 - 铬错误,还是我失明?
- 6. 自定义虚线边框。
- 7. 自定义边框 - CSS
- 8. 自定义表单边框
- 9. UIImageView与自定义边框
- 10. uitextfield的自定义边框
- 11. 表与自定义边框
- 12. 自定义AlertDialog边框
- 13. 使用自定义边框
- 14. android自定义togglebutton边框
- 15. 边框消失在铬当指定百分比高度
- 16. 确定点是否在边界框内
- 17. 透明度在边框右边的CSS
- 18. 嵌套明确定义
- 19. 明确定义接口
- 20. 透明边框内
- 21. 在TextBox上自定义边框
- 22. HQL明确定义在哪里?
- 23. Bootstrap 4:自定义复选框边框
- 24. GalleryView的自定义边框框架
- 25. 边框半径即Firefox的铬冲突
- 26. 边框属性为IE冲突和铬
- 27. 铬输入中的未知边框
- 28. 铬渲染错误与边框崩溃
- 29. 为什么我的边框太宽铬
- 30. 正确的自定义过渡自定义转换方式 - 无边框效果
也许你的问题是你的CSS,而不是Webkit的。 –