CSS Grid 布局之左中右三栏布局案例

 
更多

CSS Grid 布局之左中右三栏布局案例。

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
    <title>CSS Grid 布局之左中右三栏布局案例</title>
    <style type="text/css">
        *{margin:0;padding:0;}
        body, html{text-align:center;margin:0 auto;}
        .box, .content{display:grid;}
        .box{grid-template-rows: 1fr;grid-row-gap:10px;color:#fff;width:80vw;margin:0 auto;}
        .header{height:100px;}
        .content{height:400px;grid-template-columns: 120px 1fr;grid-column-gap:10px;}
        .footer{height:80px;}
        .header, .content *, .footer{background-color:#7AB8ED;}
    </style>
</head>
<body>
<div class="box">
    <div class="header">header</div>
    <div class="content">
        <div>nav</div>
        <div>article</div>
    </div>
    <div class="footer">footer</div>
</div>
</body>
</html>
打赏

本文固定链接: https://www.cxy163.net/archives/3082 | 绝缘体

该日志由 绝缘体.. 于 2023年05月15日 发表在 未分类 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: CSS Grid 布局之左中右三栏布局案例 | 绝缘体
关键字: , , , ,

CSS Grid 布局之左中右三栏布局案例:等您坐沙发呢!

发表评论


快捷键:Ctrl+Enter