【问题标题】:How to combine media query in scss如何在scss中结合媒体查询
【发布时间】:2018-02-15 16:59:23
【问题描述】:

我想用逗号来组合媒体查询,但没有用

@media all and (min-width: 600px) and (orientation: portrait),
@media all and (min-width: 601px) and (max-width: 840px) and (orientation : portrait) {}

任何想法如何在 scss 中做到这一点?

【问题讨论】:

    标签: css sass media-queries


    【解决方案1】:

    去掉第二行的@media:

    @media all and (min-width: 600px) and (orientation: portrait),
    all and (min-width: 601px) and (max-width: 840px) and (orientation : portrait) {}
    

    顺便说一句,这与 SCSS 无关。这也是您在纯 CSS 中声明媒体查询的方式。这是一些文档,请参阅逗号分隔列表 - https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

    【讨论】:

    猜你喜欢
    • 2021-12-25
    • 2012-02-18
    • 1970-01-01
    • 2017-03-13
    • 2023-04-07
    • 2018-07-05
    • 2012-11-27
    • 2013-12-22
    • 2014-03-28
    相关资源
    最近更新 更多