V
V
vasIvas2015-11-03 14:06:09
css
vasIvas, 2015-11-03 14:06:09

Why doesn't @media work correctly?

Here is the code on codepen . If you shrink the browser to a media query that sets a green background and click a button to hide the square, zooming in to a red background does not return the square. Why? If you look in the debugger, you can see that display: none and if you manually set it to display: block, then the square becomes visible again. It turns out that the media query does not work, but what about the red background color...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Lyzlov, 2015-11-03
@vasIvas

Works out. It's just that when you hide via element.style, it takes precedence over style.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question