美文网首页
移动端自适应处理--css3 @media

移动端自适应处理--css3 @media

作者: stone_yao | 来源:发表于2016-05-25 23:33 被阅读555次

    http://www.w3schools.com/cssref/css3_pr_mediaquery.asp
    http://www.w3cplus.com/content/css3-media-queries

    The @media rule is used to define different style rules for different media types/devices.

    Two syntax---only|not is not always necessary

    @media not|only mediatype and (media feature) {
        CSS-Code;
    }
    
    <link rel="stylesheet" media="mediatype and|not|only (media feature)" href="mystylesheet.css">
    

    To use the @media rule to make responsive design,such as

    @media only screen and (max-width:500px){
     .gridmenu {
            width:100%;
        }
    
        .gridmain {
            width:100%;
        }
    
        .gridright {
            width:100%;
        }
    }
    

    相关文章

      网友评论

          本文标题:移动端自适应处理--css3 @media

          本文链接:https://www.haomeiwen.com/subject/bvgtdttx.html