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

555 views Asked by At

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

2

There are 2 answers

0
JiiB On

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

0
dealwap On

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;
    }
 }