CSS Webkit高度 [英] CSS webkit height

查看:89
本文介绍了CSS Webkit高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对div框有问题,它必须具有特定的高度:241px。
在所有浏览器中均显示正确,但在chrome和safari中仅显示230px高度

i have an problem with a div box, which has to get a specific height: 241px. In all browser it is displayed right, but in chrome and safari it dis only 230px height

是否存在可能性,例如,可以使用css hack进行修改

Is there a possiblility, per example with a css hack to modify this box only in webkit browsers?

推荐答案

通过将CSS规则放置在基于媒体的浏览器中,可以仅将CSS规则应用于基于webkit的浏览器引用Webkit特定属性的查询:

It's possible to apply CSS rules only on webkit-based browsers by placing them in a media query referencing a webkit specific property:

@media screen and (-webkit-min-device-pixel-ratio:0) {
    /* webkit specific CSS */
    div#mydiv { height:241px; }
}

这篇关于CSS Webkit高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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