01Bootstrap5容器

01Bootstrap5容器

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>菜鸟教程Bootstrap5容器</title>
    <link rel="stylesheet" href="../css/bootstrap.min.css">
</head>
<body>
<!--container用于创建固定宽度的响应式页面-->
<!--max-width会根据屏幕宽度同比列放大或缩小-->
<div class="container">
    <h1>你好,bootstrap5</h1>
</div>
<!--.container-fluid创建一个全屏幕尺寸的容器,容器始终跨越整个屏幕width始终为100%-->
<div class="container-fluid">
    <h1>你好,bootstrap5</h1>
</div>
<!--默认情况下容器内部都有填充左右内边距,顶部和底部没有填充内边距。Bootstrap提供了一些间距类用于填充边距-->
<!--pt-5 填充顶部内边距-->
<div class="container pt-5">
    <h1>你好,bootstrap5</h1>
</div>
<!--边框border、颜色bg-dark、bg-primary等-->
<div class="p-5 my-5 border">
    <h1>你好,bootstrap5</h1>
</div>
<div class="container p-5 my-5 bg-dark text-white">
    <h1>你好,bootstrap</h1>
</div>
<div class="p-5 my-5 bg-primary text-white">
    <h1>你好,bootstrap</h1>
</div>
<!--响应式容器-->
<!--.container-sm|md|lg|xl|xxl等创建响应式容器(max-width)属性根据屏幕大小来改变-->
<div class="container-sm bg-dark text-white">
    <h1>你好,bootstrap</h1>
</div>
<div class="container-md bg-dark text-white">
    <h1>你好,bootstrap</h1>
</div>
<div class="container-lg bg-dark text-white">
    <h1>你好,bootstrap</h1>
</div>
<div class="container-xl bg-dark text-white">
    <h1>你好,bootstrap</h1>
</div>
<div class="container-xxl bg-dark text-white">
    <h1>你好,bootstrap</h1>
</div>
</body>
</html>

在这里插入图片描述

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

夏至xz

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值