Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 73905

Media queries not working despite simple use

$
0
0

I have a very simple media query. However, it is not working. Here's the code:

<!DOCTYPE html><html><head><meta content="width=device-width, initial-scale=1" name="viewport" /><style>
    #landscape-div {
      display: none;
    }

    @media (min-width: 800px) {
      #landscape-div {
        display: block;
      }
    }
    
  
  </style></head><body><div id="landscape-div">fsfsfsfsfsdd</div></body></html>

Expected result: the div should show up only when the minimum width is more than 800px.

However, it is showing up all the time. Why is this happening?

Edit: Edited the code as suggested by answers. Still not working.


Viewing all articles
Browse latest Browse all 73905

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>