示例工程 54-layout-shell
54-layout-shell/demo-02-container/index.html
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>容器与全宽</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<section class="band">
<div class="container">
<h1>容器</h1>
<p>内容最大 72rem,两侧自动留白。</p>
</div>
</section>
<section class="band alt">
<div class="container narrow">
<p>窄容器适合正文,最大 60ch。</p>
</div>
</section>
<section class="band full">
<p>全宽区域:背景铺满,内容仍可加容器。</p>
</section>
</body>
</html>