首页 > 解决方案 > 我正在使用 bootstrap v4.5,由于某种原因,当我使用 jumbotron 时,它会占据页面的整个宽度。我没有使用 jumbotron-fluid

问题描述

我正在使用 bootstrap v4.5,由于某种原因,当我使用 jumbotron 时,它会占据页面的整个宽度。我没有使用jumbotron-fluid。有人可以让我知道我做错了什么吗?

这是我的代码。

<div class="jumbotron part2">
        
        <h1 class="display-4">My Website</h1>
       
        <p class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.</p>
        <hr class="my-4">
        <p>It uses utility classes for typography and spacing to space content out within the larger container.</p>
        <a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
        
      </div>
        






    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
        crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
        crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
        crossorigin="anonymous"></script>
</body>

</html>

jumbotron流体。

标签: htmlbootstrap-4

解决方案


推荐阅读