Bootstrap Jumbotron文本溢出问题

发布于 2025-01-18 05:20:24 字数 993 浏览 2 评论 0原文

文字从大屏幕中溢出。 在此处输入图像描述

遵循引导文档中的 jumbotron 示例,无法弄清楚为什么格式无法容纳其中的文本巨型屏幕。

<div class="jumbotron jumbotron-fluid ">
  <div class="container ml-4 mr-3 mb-4">
    <img align='center' src="{{ url_for('static', filename='product_pics/' + product.product_image)}}"  alt="...">
    <h1 >{{ product.title }}</h1>
    <h5>Created by: {{product.author.username}}</h5>
    <h6>Published: {{ product.date.strftime('%B %d, %Y') }}</h6>
    <p class="lead">{{product.text}}</p>
    
    {% if product.author == current_user %}
      <div>
        <a class="btn btn-secondary" href="{{ url_for('products.update', product_id=product.id) }}">Update</a>
        <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#del_modal">Delete</button>
        </div>
    {% endif %}
  </div>
</div>

Text overflows out of jumbotron.
enter image description here

Followed the sample of jumbotron from the bootstrap documentation, not able to figure out why the formatting cannot fit text within jumbotron.

<div class="jumbotron jumbotron-fluid ">
  <div class="container ml-4 mr-3 mb-4">
    <img align='center' src="{{ url_for('static', filename='product_pics/' + product.product_image)}}"  alt="...">
    <h1 >{{ product.title }}</h1>
    <h5>Created by: {{product.author.username}}</h5>
    <h6>Published: {{ product.date.strftime('%B %d, %Y') }}</h6>
    <p class="lead">{{product.text}}</p>
    
    {% if product.author == current_user %}
      <div>
        <a class="btn btn-secondary" href="{{ url_for('products.update', product_id=product.id) }}">Update</a>
        <button type="button" class="btn btn-danger" data-toggle="modal" data-target="#del_modal">Delete</button>
        </div>
    {% endif %}
  </div>
</div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

世态炎凉 2025-01-25 05:20:24

尝试将text-wrap添加到&lt; p&gt;类。

 <p class="lead text-wrap">{{product.text}}</p>

Try adding text-wrap to the <p> class.

 <p class="lead text-wrap">{{product.text}}</p>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文