Hello! There is a task: there are 2 classes with styles on the div, for example: .style1 and style2. With a certain resolution of .style2 I do not need (I want to return the default div properties, which I redefined in .style2). I know how to do this on js, is there a more elegant solution?

  • there is, and what is the context of the problem? at what point should style2 be removed? - arkadij_ok
  • Thank you, I have already solved the problem, the solution of Victor Khovanskiy came up to me - La_Concorde

1 answer 1

Delete does not work, but you can simply specify the attributes only for a specific permission. For example:

 <div class="style1 style2">...</div> 

and

 .style1 { color: red; } @media screen and (device-width: 1280px) { style2 { color: green; } }