I have a problem with media queries , the width value does not work, instead the previous value continues to work - .hero-text-box . I tried to determine the color using the same media queries and everything worked. Perhaps because the color was not defined in the main CSS file. (I have 2 CSS files: style.css & queries.css ).

enter code here

  • one
    File with media styles is connected before the main one - slowBro
  • Ay Rakhmet big, buddy! I'm already breaking my head for the 3rd hour)) - Magzhan

1 answer 1

Decision

In this case, you can simply add an ancestor to the selector, which has higher priority, for example body :

 @media screen and (max-width:1024px) { body your_selector { width: 100%; } } 

Or you can !important , but not necessary:

 @media screen and (max-width:1024px) { your_selector { width: 100% !important; } } 
  • Wow! Thank! I think it is useful. - Magzhan
  • @ Magzhan please, once helped) - user192664
  • Nikita, soryan, Thanks again! - Magzhan