'How can i set @media only screen less then 320px for indetificator?

I have this piece of code. I'm beginner :/

https://ibb.co/ccrFFG Id like to add some responsibility by @media only screen and (max-width: 320px) {} but it doesnt works with IDs. How would you change the code pls? :)

Thanks



Solution 1:[1]

From your code, I don't know exactly what you are trying to achieve but I will advise you to use the code below as a guide.

  @media screen and (max-width: 320px) {
    #yourID {
        width: 260px !important;
    }
 }

Solution 2:[2]

css media-querys only work if you use the viewport meta-tag, make sure that you use it on your site.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

You can ready more about it here: https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 dealwap
Solution 2 JiiB