码迷,mamicode.com
首页 > 其他好文 > 详细

grid-layout实验

时间:2018-09-27 01:42:27      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:width   meta   height   back   max   row   round   doc   head   

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<style>
    * {margin: 0;padding: 0;}
    html,body {width: 100%;height: 100%;}
    .container {
        display: grid;
        grid-template-columns: 33.333333% 33.333333% 33.333333%;
          grid-template-rows: auto;
    }
    .item {
        background-color: #444;
        color: #fff;
        font-size: 150%;
        padding: 20px;
        margin: 3.333333%;
    }
    .item-5 {
        grid-column-start: 2;
        grid-column-end: 4;
        grid-row-start: 2;
        grid-row-end: 4;
    }
    .item-7 {
        grid-column-start: 1;
        grid-column-end: 3;
        grid-row-start: 4;
        grid-row-end: 4;
    }
    .item-12 {
        grid-column-start: 1;
        grid-column-end: 4;
        grid-row-start: 6;
        grid-row-end: 6;
    }
</style>
</head>
<body>

<div class="container">
    <div class="item item-1">1</div>
    <div class="item item-2">2</div>
    <div class="item item-3">3</div>
    <div class="item item-4">4</div>
    <div class="item item-5">5</div>
    <div class="item item-6">6</div>
    <div class="item item-7">7</div>
    <div class="item item-8">8</div>
    <div class="item item-9">9</div>
    <div class="item item-10">10</div>
    <div class="item item-11">11</div>
    <div class="item item-12">12</div>
</div>

</body> 
</html>

 

grid-layout实验

标签:width   meta   height   back   max   row   round   doc   head   

原文地址:https://www.cnblogs.com/lldy/p/9710647.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!