12栅格化布局

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<style>
.container{
width: 900px;
height: 300px;
overflow: hidden;
box-sizing: border-box;
}
.container>.row{
width: 100%;
height:100%;
float: left;
overflow: hidden;
}


@media screen and (min-width: 600px){
.container{
width: 600px;
height: 300px;
border:1px solid #333;
box-sizing: border-box;
}
.container>.row>.col-l-1{
width: 8.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-l-2{
width: 16.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-l-3{
width: 25%;
height: 100%;
float: left;
}
.container>.row>.col-l-4{
width: 33.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-l-5{
width: 41.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-l-6{
width: 50%;
height: 100%;
float: left;
}
.container>.row>.col-l-7{
width: 58.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-l-8{
width: 66.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-l-9{
width: 75%;
height: 100%;
float: left;
}
.container>.row>.col-l-10{
width: 83.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-l-11{
width: 91.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-l-12{
width: 100%;
height: 100%;
float: left;
}
}


@media screen and (min-width: 900px){
.container{
width: 900px;
height: 300px;
border:1px solid #333;
box-sizing: border-box;
}
.container>.row>.col-s-1{
width: 8.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-s-2{
width: 16.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-s-3{
width: 25%;
height: 100%;
float: left;
}
.container>.row>.col-s-4{
width: 33.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-s-5{
width: 41.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-s-6{
width: 50%;
height: 100%;
float: left;
}
.container>.row>.col-s-7{
width: 58.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-s-8{
width: 66.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-s-9{
width: 75%;
height: 100%;
float: left;
}
.container>.row>.col-s-10{
width: 83.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-s-11{
width: 91.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-s-12{
width: 100%;
height: 100%;
float: left;
}
}


@media screen and (min-width: 1200px){
.container{
width: 1200px;
height: 300px;
border:1px solid #333;
box-sizing: border-box;
}
.container>.row>.col-m-1{
width: 8.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-m-2{
width: 16.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-m-3{
width: 25%;
height: 100%;
float: left;
}
.container>.row>.col-m-4{
width: 33.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-m-5{
width: 41.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-m-6{
width: 50%;
height: 100%;
float: left;
}
.container>.row>.col-m-7{
width: 58.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-m-8{
width: 66.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-m-9{
width: 75%;
height: 100%;
float: left;
}
.container>.row>.col-m-10{
width: 83.3333333%;
height: 100%;
float: left;
}
.container>.row>.col-m-11{
width: 91.6666666%;
height: 100%;
float: left;
}
.container>.row>.col-m-12{
width: 100%;
height: 100%;
float: left;
}
}


div>[class*=col]{
border:1px solid red;
box-sizing: border-box;
}
</style>
<body>
<div class="container">
<div class="row">
<div class="col-m-3 col-s-4 col-l-6"></div>
<div class="col-m-3 col-s-4 col-l-6"></div>
<div class="col-m-3 col-s-4"></div>
<div class="col-m-3"></div>
</div>
</div>
</body>
</html>

转载于:https://www.cnblogs.com/weigaojie/p/11198279.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值