简体   繁体   English

CSS Media查询可在Chrome中使用,但不适用于Firefox或Safari浏览器

[英]CSS Media queries works in Chrome but not firefox or safari

I'm new on stackoverflow and would appreciate and help/input on this matter. 我是stackoverflow的新手,希望能对此提供帮助和帮助。

I have been working on a site and it works fine on chrome and is responsive to different device sizes. 我一直在一个网站上工作,它在chrome上可以正常工作,并且可以响应不同的设备尺寸。 I tested it on numerous devices. 我在众多设备上进行了测试。 However, on firefox it looks good on my 27"mac which i designed it too, but smaller screen devices it's not working. It's like it's not detecting the media queries at all. 但是,在firefox上,我也在我设计的27英寸Mac上看起来不错,但是在较小的屏幕设备上却无法使用。这就像它根本没有检测到媒体查询一样。

Here is a link to the site: www.ujimatrading.com 这是该网站的链接:www.ujimatrading.com

and here is a paste of the media query css: http://pastebin.com/uQgzxeTQ 这是媒体查询CSS的粘贴: http : //pastebin.com/uQgzxeTQ

Sorry but i'm a backend developer and not really into front-end stuff so any tips would be highly appreciated. 抱歉,但是我是一个后端开发人员,并不真正涉足前端工作,因此任何提示都将受到高度赞赏。

Many Thanks 非常感谢

You've got some bad nesting going on. 您正在进行一些不良的嵌套。

Try cleaning it up like this: 尝试像这样清理它:

@media screen and (max-width://pixels) { 

}
@media screen and (max-width://pixels) {

}

Sounds like the Viewport hasn't been set. 听起来好像尚未设置视口。 Try adding this to your html code: 尝试将其添加到您的html代码中:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Explaination here 在这里讲解

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 媒体查询只能在Chrome浏览器中使用,而不能在Safari(例如Firefox)中使用? - Media queries working in chrome but not safari, ie, or firefox? 媒体查询无法在Safari中工作,但在IE,Firefox和Chrome中 - Media queries not working in Safari but in IE, Firefox and Chrome 媒体查询无法在Chrome中使用,但可以在Firefox中使用 - Media Queries not working in Chrome, works in Firefox 媒体查询CSS在Safari中工作,但在Chrome中失败 - Media Queries css working in safari but fails in chrome CSS媒体查询在Safari浏览器中不起作用 - Css media queries not works in Safari browser CSS文件可在Safari中使用,但不能在Google Chrome或Firefox中使用 - CSS file works in Safari but not in Google Chrome or Firefox CSS 动画在 chrome 中有效,但在 Firefox 和 Safari 中无效 - CSS animation works in chrome but not in firefox and Safari HTML,CSS和媒体查询-在Chrome和firefox上调整大小不同 - HTML, CSS & Media-queries - resizing on Chrome and firefox is different CSS子菜单定位可在Chrome和Safari中使用,但不适用于IE和Firefox - CSS Sub-menu positioning works in Chrome & Safari, but not IE and Firefox 内联CSS背景未在Chrome / Safari / IE上显示,但可在Mozilla Firefox上使用 - Inline css background not showing on Chrome/Safari/IE but it works on Mozilla Firefox
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM