0
我创建了一个完全工作的网站。媒体查询未运行
我把媒体查询..根据前面的响应式网站,但它不工作在我的网站。
这是我的网站www.itztotalsolutions.us,我试图添加媒体查询使响应,但有一个没有媒体查询效果在手机或ipad ..在这里我提到,我有移动和ipad网站的外观问题。它看起来像我们在桌面上看到的正常网站,而不是我为手机和Ipad编写的CSS ...意味着它不会检测到设备分辨率。
这是代码。在标题:
<meta name="viewport" content="width=device-width" />
在style.css中:
body, html { height: 100%;}
body {
font-size: 12px;
line-height: 18px;
font-family: arial, sans-serif;
width:100%;
margin:auto;
background:url(images/main-full-bg.jpg) repeat #F60;
background-size:cover;
}
...etc.... all CSS for pages.. after it
/* ipad portrait */
@media only screen and (min-device-width : 768px) and (max-device-width : 980px) {
body { min-width: 768px; }
.shell { max-width: 748px; }
#navigation ul li { padding-left: 24px; font-size: 15px; }
.header-top { padding-left: 20px; padding-right: 20px; }
}
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
body { min-width: 320px; }
.shell { max-width: 320px; }
.header .shell { padding:0; background: url(images/m-header-shell.jpg) no-repeat 0 0; }
.header-top { padding: 0px 0 0px 0; }
#logo { margin: 0 auto; float: none; display: block; }
}
@media only screen and (max-width: 767px) and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
#logo a { background: url(images/[email protected]) no-repeat 0 0; -webkit-background-size: 142px 57px; -moz-background-size: 142px 57px; background-size: 142px 17px; }
#navigation { background: url(images/[email protected]) no-repeat 0 0; -webkit-background-size: 298px 32px; -moz-background-size: 298px 32px; background-size: 298px 32px; }
#navigation a.nav-btn span { background: url(images/nav-arr[email protected]) no-repeat 0 0; -webkit-background-size: 10px 15px; -moz-background-size: 10px 15px; background-size: 10px 15px; }
.pagination a { background: url(images/[email protected]) no-repeat 0 1px; -webkit-background-size: 18px 40px; -moz-background-size: 18px 40px; background-size: 18px 40px; }
.main section { background: url(images/[email protected]) no-repeat center bottom; -webkit-background-size: 300px 10px; -moz-background-size: 300px 10px; background-size: 300px 10px; }
}
我检查,当我在手机上运行似乎CSS从默认的CSS不是从查询CSS运行。
请帮我解决这个
什么是标题? – BoltClock
你能否更详细地描述问题? “它不适合我的网站”不是一个很好的描述。你期望这个代码做什么,它实际上做了什么? –
您正在IE8中尝试媒体查询?你使用什么浏览器? –