CSS media query height greater than width and vice versa (or how to imitate with JavaScript)

后端 未结 2 1374
既然无缘
既然无缘 2020-12-29 03:52

The majority of desktop and laptop screens nowadays have a width greater than the height. The screen is \"wide\" not \"tall.\" Smart phones have done something rather cool b

2条回答
  •  Happy的楠姐
    2020-12-29 03:57

    Media Queries are probably going to be your solution here for the modern browsers that support it. You can grab a copy of the documentation from here:

    http://www.w3.org/TR/css3-mediaqueries/

    But you might find the following tutorial useful (Google for: Media Queries Tutorial):

    http://webdesignerwall.com/tutorials/css3-media-queries

    Once you pick up the basics doing things like hiding elements if the screen falls below a specific resolution:

    @media screen and (max-width: 600px)
    {
      .sidebar
      {
        display: none;
      }
    }
    

    Hope this helps.

提交回复
热议问题