【问题标题】:Using media queries for mobile devices使用移动设备的媒体查询
【发布时间】:2015-01-09 14:18:22
【问题描述】:
【问题讨论】:
标签:
css
mobile
media-queries
【解决方案1】:
您已为正文内容的左侧和右侧应用了 100 像素的内边距。对于移动设备,您应该使用媒体查询来减少或删除它。
@media screen and (max-width: 400px) {
body
{
padding:0px 10px;
}
}
【解决方案2】:
在页面上添加这个 css 它将适用于所有移动设备
@media screen and (max-width:640px) {
body {
background: none repeat scroll 0 0 #fff;
padding: 0;
}
#page {
background-color: #fff;
margin: 0 auto;
max-width: 100%;
padding: 0 1.11111rem;
}
img {
height: auto;
max-width: 100% !important;
}
.site-main {
width: 100%;
}
.simple-social-icons ul li a, .simple-social-icons ul li a:hover {
background-color: #fff !important;
border-radius: 3px;
color: #ccc !important;
font-size: 24px;
padding: 8px;
}
}