如何在 angular 组件的styles.scss 中使用媒体查询?

Mar*_*old 3 html css media-queries responsive angular

我试图在组件的样式中使用媒体查询,但是当我调整窗口大小时,没有任何反应

 @media query screen and (max-width: 768px) { 
/* Here are some changes*/
}
Run Code Online (Sandbox Code Playgroud)

它根本不起作用,我是否需要加载一些模块或如何修复它。任何帮助表示赞赏。

小智 7

使用以下语法。这是媒体查询的正确语法。希望这可以帮助!!

@media only screen and (max-width: 768px) { 
    /* Here are some changes*/
}
Run Code Online (Sandbox Code Playgroud)