Change layout based on screen size

后端 未结 2 1470
暖寄归人
暖寄归人 2021-01-27 13:24

I would like the content of my website header to occupy 100% of the screen width on regular-sized desktops/laptops, but to be centered on larger displays. By \"larger displays\"

2条回答
  •  感情败类
    2021-01-27 13:53

    Try out setting media screen and limitation through min-width. http://www.w3schools.com/cssref/css3_pr_mediaquery.asp

    @media screen and (min-width: 1200px) {
          .container {
              width: 100%;
          }
      }
    
    @media screen and (min-width: 1920px) {
          .container {
              width: 500px;
          }
      }
    

提交回复
热议问题