media query not working properly in vs code

36 Views Asked by At
`@media(min-width:300px)and(max-width:400px){
    div{
        background-color: pink;
    }
}`

I tried this while learning responsive websites. But in vs code this is not working. I had also checked for any updates in vs code but there's no update at this moment.

`@media(min-width:300px)and(max-width:400px){
    div{
        background-color: pink;
    }
}`

I want this to be done

1

There are 1 best solutions below

0
Mehdi On BEST ANSWER

You should keep the space before and after "and", this should work:

@media (min-width:300px) and (max-width:400px){
    div{
        background-color: pink;
    }
}