3 Div盒不适合放入容器 [英] 3 Div boxes do not fit in the container

查看:33
本文介绍了3 Div盒不适合放入容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在页面上: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;
}

您不应使用某些来硬编码宽度像素值而不是删除像素值。

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

希望这对您有所帮助。

这篇关于3 Div盒不适合放入容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆