locked
show and hide div based on media screen size RRS feed

  • Question

  • User-1243688316 posted

    Hi every one :)

    i have two div and want to show "#chooseImg_Small" in screens with width smaller than 800px and othe div in wider than 800px!
    my css work in small screens but don't work in wider screens!!!

    @media screen and (min-width: 0px) and (max-width: 800px) {
      #chooseImg_Wide { display: none; } 
      #chooseImg_Small { display: block; } 
    }
    
    @media screen and (width: 801px) and (max-width:3250px) {
        #chooseImg_Small {
            display: none;
        }
    
        #chooseImg_Wide {
            display: block;
        }
    }

    thanks for any help :)

    Friday, August 12, 2016 6:08 PM

Answers

  • User-2010311731 posted

    @media screen and (width: 801px) and (max-width:3250px) {

    You need to use min-width...

    @media screen and (min-width: 801px) and (max-width:3250px) {
    

    Matt

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 12, 2016 9:57 PM