container
![](https://img-blog.csdnimg.cn/direct/2410427f2e124a34a70b8711185f1c1b.png)
![](https://img-blog.csdnimg.cn/direct/8304a38be1a941ecbc8dbdc486883540.png)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<link href="https://www.w3school.com.cn/lib/bs/bootstrap.css" rel="stylesheet">
<!-- 引入 bootstrap.css -->
<script src="https://www.w3school.com.cn/lib/bs/bootstrap.js"></script>
<!-- 引入 bootstrap.js -->
<style>
div {
text-align: center;
}
</style>
</head>
<body>
<div class="container bg-primary">
<h1>Hello World</h1>
<p>欢迎学习 Bootstrap5!</p>
</div>
</body>
</html>
<!--
固定容器:container
注意!
固定容器(container)不占全宽,只占部分。
-->