Fancy Media Queries with some LESS Magic

后端 未结 8 1440
别跟我提以往
别跟我提以往 2020-12-04 05:23

It would be nice to wrap css-styles for different resolutions within some css-classes using less.

I\'d like to do something like:

footer {
  width: 1         


        
8条回答
  •  不知归路
    2020-12-04 05:52

    And this is what I have used for my project:

        @mobile:   ~"only screen and (min-width: 320px) and (max-width: 767px)";
        @tablet:    ~"only screen and (min-width: 768px) and (max-width: 991px)";
        @ipad:    ~"only screen and (min-width: 992px) and (max-width: 1024px)";
    
        @media @mobile {
          .banner{
            width: auto;
          }
        }
    
        @media @tablet {
          .banner{
            width: 720px;
          }
        }
    
      @media @ipad {
          .banner{
            width: 920px;
          }
        }
    

提交回复
热议问题