当屏幕小于设定像素时:
CSS
@media screen and (max-width: 768px) {
select.DashSelecter{
width: 100%;
height: 50px;
font-size: 14px;
color: #7f7f7f;
outline: none;
border: 1px solid #9e9e9e66;
border-radius: 3px;
padding: 10px;
margin: 5px 0 8px 0;
}
input.DashInput{
width: 100%;
display: initial;
}
}
参数:@media screen and (max-width: 768px) {}
当屏幕像素小于 768px 时,响应 select.DashSelecter{} 和 input.DashInput{}
样式;
如果要设置于区间
参数:@media screen and (max-width: 768px) {}
改为 @media only screen and (min-width: 767px) and (max-width: 1024px) {}
当屏幕像素在 767px 至 1024px 区间时,响应 select.DashSelecter{}
和 input.DashInput{}
样式;
当屏幕大于设定像素时:
CSS
@media screen and (min-width: 768px) {
select.DashSelecter{
width: 100%;
height: 50px;
font-size: 14px;
color: #7f7f7f;
outline: none;
border: 1px solid #9e9e9e66;
border-radius: 3px;
padding: 10px;
margin: 5px 0 8px 0;
}
input.DashInput{
width: 100%;
display: initial;
}
}
参数:@media screen and (min-width: 768px) {}
即将 max-width:
该为 min-width:
,max 为小于设定值,min 为大于设定值。
更多通用参考模板:
CSS
@media only screen and (min-width: 310px) and (max-width: 360px) {
.Notice {display:none;
}
}
@media only screen and (min-width: 360px) and (max-width: 374px) {
.Notice {display:none;
}
}
@media only screen and (min-width: 375px) and (max-width: 400px) {
.Notice {display:none;
}
}
@media only screen and (min-width: 400px) and (max-width: 767px) {
.Notice {display:none;
}
}
@media only screen and (min-width: 767px) and (max-width: 1024px) {
.Notice {display:none;
}
}
0 条评论