gpt4 book ai didi

css - 如何在 CSS 中为 Ipad 和平板电脑的纵向和横向设置媒体查询

转载 作者:行者123 更新时间:2023-11-27 23:57:15 24 4
gpt4 key购买 nike

当我使用此代码(见下文)时,媒体查询不起作用

@media (min-width: 768px) and (orientation : portrait) { //scss code }

但是当我删除 'and (orientation : portrait)' 部分时它起作用了。即

//this code works
@media (min-width: 768px) { //scss code }

如何在 CSS 中为 Ipad 和平板电脑设置纵向和横向的媒体查询?

PS:我正在为网络编写一个响应式布局,我正在使用 scss mixins(不知道这是否会影响任何东西。)

最佳答案

试试这段代码

    @media screen and (min-width: 768px) and (max-width: 992px) { 
/* STYLES HERE */
}

关于css - 如何在 CSS 中为 Ipad 和平板电脑的纵向和横向设置媒体查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56198013/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com