【发布时间】:2020-10-25 22:12:54
【问题描述】:
CSS 中@media (max-width: 1000px) 和@media and screen (max-width: 1000px) 有什么区别?我在我的代码中分别尝试了它们,它们都做同样的事情
@media and screen (max-width: 1000px) {
.grid {
width:100%;
{
}
和
@media (max-width: 1000px) {
.grid {
width:100%;
{
}
当屏幕宽度为 1000 像素或更小时,两者对我的网格元素的效果相同
如果没有 CSS 指南,为什么我们会得到相同的结果?
【问题讨论】:
-
第一个是无效的语法,但如果你问的是
screen and,What is the difference between “screen” and “only screen” in media queries? 的副本:“这几乎与上面的相同,除了你将screen指定为与other available media types相对,最常见的另一个是print。” -
查看我编辑的答案@Aviale
标签: html css media-queries