3 分箱不适合容器

2022-01-24 00:00:00 containers html twitter-bootstrap-3

在页面上:jerkydirect.com/base/opportunity - 包含图片的容器中有 3 个框.然而,当在大屏幕上观看时 - 最后一个框贴在右侧.它在较小的窗口或移动设备上看起来很棒,但在较大的屏幕上却不行.我如何让它正确对齐?

On the Page: jerkydirect.com/base/opportunity - There are 3 boxes within the container with the picture. However, when viewed on a Large Screen - the last box sticks over the right side. It looks great in a smaller window or mobile but not on a larger screen. How do i get this to align correctly?

代码如下:

<section class="plan-box opportunity">
  <div class="container">
    <div class="row">
      <h2>Choose Your Crave:</h2>

      <div class="col-xs-12 col-sm-12 col-md-12">
        <center>
          <div class="package">
            <h3>Twin Pack</h3>
            <p>2 BAGS</p>
            <ul>
              <li><span>Affiliate Price: </span><span>$19.75</span></li>
              <li><span>Retail Price:</span><span>$21.75</span></li>
              <li><span>Commission Payout:</span><span>$5.00</span></li>
            </ul>
          </div>
        </center>
      </div>

      <div class="col-xs-12 col-sm-12 col-md-4">
        <div class="package">
          <h3>family Pack <span></span></h3>
          <p>4 BAGS</p>
          <ul>
            <li><span>Affiliate Price: </span><span>$39.50</span></li>
            <li><span>Retail Price:</span><span>$41.50</span></li>
            <li><span>Commission Payout:</span><span>$10</span></li>
          </ul>
        </div>
      </div>

      <div class="col-xs-12 col-sm-12 col-md-4">
        <div class="package">
          <h3>Party Pack <span></span></h3>
          <p>10 BAGS</p>
          <ul>
            <li><span>Affiliate Price: </span><span>$79.75</span></li>
            <li><span>Retail Price:</span><span>$87.75</span></li>
            <li><span>Commission Payout:</span><span>$15</span></li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</section>

推荐答案

你的 HTML 代码没问题.

问题在于您的 CSS

.package {
  width: 350px;
  height: 230px;
  background-color: rgba(0,0,0,0.6);
  border: 15px solid rgba(52,53,48,0.6);
  margin: 50px 0 0;
  padding: 25px 20px;
}

您不应该用一些 pixel 值硬编码宽度,而是删除像素值.

You shouldn't hard code the width with some pixel value rather remove the pixel value.

希望这会对你有所帮助.

Hope this will help you.

相关文章