bootstrap的流体容器与固定容器

流体容器container-fluid

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>流体容器</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">

    <style type="text/css">
        .container-fluid{
      
      
            background: red;
        }
    </style>
</head>
<body>

<div class="container-fluid">
    test
</div>

</body>

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>

</html>

结果如下
在这里插入图片描述


固定容器container

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>固定容器</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
    <style type="text/css">
        .container{
      
      
            background: yellow;
        }
    </style>
</head>
<body>

<div class="container">
    simple
</div>

</body>

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script
<script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>

</html>

结果如下
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/fgets__/article/details/121886951