视口,移动适配等问题

https://segmentfault.com/q/1010000003043170

https://blog.csdn.net/yuyu200302/article/details/41745439

http://www.cnblogs.com/zdhblog/p/6845618.html

https://www.cnblogs.com/koukouyifan/p/4066567.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
    <title>媒体查询</title>
    <style>
        .c {
            height: 100px;
            width: 100px;
        }
        .c1 {
            background-color: red;
        }

/*当打开网页的设备是一个显示器设备,并且显示器的宽度小于600px时,使用下面的样式*/
        @media screen and (max-width: 700px) {
            .c1 {
                background-color: green;
            }
        }
    </style>

</head>
<body>
<div class="c c1"></div>
</body>
<html>

 

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.bootcss.com/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet">
<script src="jquery-3.2.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<style>

.sb{
width:540px;
height:100px;
background-color:Bisque;
}
.sd{
width:540px;
height:100px;
background-color:grey;
}

</style>
</head>
<body>


<div class="container">

<div class="row">
<div class="col-md-6"><div class="sb"></div></div>
<div class="col-md-6"><div class="sd"></div></div>
</div>
</div>







<script>

</script>
</body>
</html>

 

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
<!-- <link href="https://cdn.bootcss.com/twitter-bootstrap/3.4.1/css/bootstrap.min.css" rel="stylesheet"> -->
<script src="jquery-3.2.1.min.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> -->
<style>
*{
padding:0;
margin:0;
}

div{background-color:gray;
}
</style>
</head>
<body>




<div>a</div>
<button>aaaaaaaaaaa fffcd</button>
<script>
$("button").click(function(){
var a=$("div").outerWidth();


$("button").text(a);
})
</script>

</body>
</html>

 

猜你喜欢

转载自www.cnblogs.com/saolv/p/10873160.html
0条评论
添加一条新回复
  
今日推荐