媒体在CSS中查询 [英] media query in css
本文介绍了媒体在CSS中查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何为1024像素宽度写媒体查询?
这里是我现有的css,我已经写了320px宽度和更多
@media(min-width:320px){
}
宽度仅为1024px的方法是什么?
解决方案
I相信你需要这个:
@media(min-width:320px)and(max-width:1023px){
/ *宽度的样式> 320px但是< 1023px * /
}
@media(min-width:1024px){
/ * styles for width> 1024px只有* /
}
这样您就不必重写任何样式。 / p>
否则你可以这样做:
@media(min-width :320px){
/ * styles for width> 320px - 应用于宽度> 1024px太* /
}
@media(min-width:1024px){
/ * styles for width> 1024px只有* /
}
这是不同的方式,你将不得不重写你的第一个媒体查询样式,在第二个
How do I write media query only for 1024px width?
Here is my existing css which i have written for 320px width and more
@media (min-width: 320px) {
}
What is the method for only 1024px width?
解决方案
I believe you want this:
@media (min-width: 320px) and (max-width: 1023px) {
/* styles for width > 320px but < 1023px */
}
@media (min-width: 1024px) {
/* styles for width > 1024px only */
}
this way you do not have to override any styles.
otherwise you can do that:
@media (min-width: 320px) {
/* styles for width > 320px - applied to width > 1024px too */
}
@media (min-width: 1024px) {
/* styles for width > 1024px only */
}
that is different in the way that you will have to override your first media query styles when needeed, in the second one
这篇关于媒体在CSS中查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文