Search code examples
htmlcssangularmedia-queriesresponsive

How to use media queries in angular component's styles.scss?


I am trying to use media query in component's styles, but when I resize the window, nothing is happens

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

It doesn't work at all, do I need to load some modules or how to fix it. Any help appreciate.


Solution

  • Use following syntax. This is the correct syntax for media query. Hope this helps!!

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