3 Div boxes do not fit in the container

2020-05-09 16:40发布

问题:

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?

Here is the code:

<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>

回答1:

Your HTML code is fine.

Problem lies with your 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.

Hope this will help you.



回答2:

Remove the <div class="container"></div> you already have one right after .inner-container.
And Content should be placed within columns, and only columns may be immediate children of rows.



回答3:

Remove width: 350px from .package div from css.

#service-one .package {
   width: auto !important;
}

Or add this style on css files