首页 > 其他 > 详细

媒体查询

时间:2019-10-13 23:03:33      阅读:81      评论:0      收藏:0      [点我收藏+]

1.背景随着边框的大小改变

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
@media only screen and (min-width: 0px) and (max-width: 768px) {
    body {
        background-color: red;
    }
}

@media only screen and (min-width: 768px) and (max-width: 992px) {
    body {
        background-color: green;
    }
}

@media only screen and (min-width: 992px) {
    body {
        background-color: blue;
    }
}
</style>
</head>
<body>

</body>
</html>

2.bootStrap

超小屏幕

手机 0-768px

小屏幕

平板768-992

中等屏幕

电脑992-1200

大屏幕

电脑1200-?

Col-xs-

Col-sm-

Col-md

Col-lg

 

2.1bootStrap使用

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
    </head>
    <body>
        <div class="container">
            <div class="row">
                <div class="col-xs-12 col-sm-6 col-md-4" style="background-color: red;">1111</div>
                <div  class="col-xs-12 col-sm-6 col-md-4" style="background-color: green;">222</div>
                <div  class="col-xs-12 col-sm-6 col-md-4" style="background-color: blue;">333</div>
            </div>
        </div>
    </body>
</html>

 

媒体查询

原文:https://www.cnblogs.com/gxlaqj/p/11668442.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!