【发布时间】:2021-06-12 06:39:42
【问题描述】:
您好,我正在为网站实施响应式设计。尽管该设计在 Firefox 中运行良好,但在 PC 和移动设备上都无法在 chrome 中运行。样式表styles-RWD.css是这个
/*CSS FOR MOBILE DEVICES*/
@media screen and (min-width: 0px) and (max-width: 480px) {
#sidebar {
display : none;
}
footer {
display : none;
}
#bann_cb {
display : none;
}
body {
width:auto;
background-color:white;
font-family: sans-serif;
color:orange;
margin:0px 2px 2px 2px;
padding:0;
}
#header {
display : none;
}
#content {
width:50%;
padding:0px 2px 2px 2px;
}
#box_bharat {
display:none;
}
#form {
width:auto;
padding:none;
}
#menu-bar {
width:auto;
}
#news_10 {
display:none;
}
#mob_heading {
display:block;
width:auto;
visibility:visible;
}
}
/*end css for mobile devices*/
默认样式在此之后。
index.php 有这些行
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" type="text/css" href="styles-rwd.css" />
现在这在 Firefox 中有效,但在 chrome 中无效。在 chrome 中它甚至没有触发。我在电脑上测试过。当我为 Firefox 减小浏览器窗口的大小时,会触发布局。但铬不会发生这种情况。在移动设备上也是如此。请帮忙。
【问题讨论】:
标签: css google-chrome firefox responsive-design