Chrome CSS Hack和媒体查询 [英] Chrome CSS Hack and Media Queries

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

问题描述

我想创建一个响应式站点,但是到目前为止,我的尝试在chrome中存在一些问题.现在的问题-将媒体查询插入chrome css hack?

I want to make a responsive site, but my attempt so far has some problems in chrome. The problem now - insert media queries into the chrome css hack?

@media screen and (-webkit-min-device-pixel-ratio:0) { 

#myid {position: absolute; top: 10px;}


@media only screen and (max-width: 1024px) {

#myid {position: absolute; top: 8px;}

}

}

仅在CSS中需要它,因此不需要javascript或php.有人知道如何解决该问题吗?

Need it only in css, so no javascript or php. Anyone an idea how to solve that problem?

推荐答案

我想在评论中暗示的答案是:

The answer you want to hear, and that I hinted at in a comment, is:

@media screen and (-webkit-min-device-pixel-ratio:0) { 
    #myid {position: absolute; top: 10px;}
}

@media screen and (-webkit-min-device-pixel-ratio:0) and (max-width: 1024px) {
    #myid {position: absolute; top: 8px;}
}​

我想解决您的根本问题...

As much as I'd like to solve your underlying problem...

我通过@ font-face添加了一种字体,该字体在 铬和即.所有的行高都被破坏"了,所以我使用了hack.

I´ve added a font via @font-face which is rendered differently in chrome and ie. All line-heights was "destroyed" so i used the hack.

?!

这篇关于Chrome CSS Hack和媒体查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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