在页面上:jerkydirect.com/base/opportunity - 容器中有3个框与图片。但是,在大屏幕上观看时 - 最后一个框粘在右侧。 它在较小的窗口或移动设备中看起来很棒,但在较大的屏幕上却看不到。 如何正确对齐?
以下是代码:
<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>
答案 0 :(得分:1)
您的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
值对宽度进行硬编码,而是删除像素值。
希望这会对你有所帮助。
答案 1 :(得分:0)
在<div class="container"></div>
之后立即删除您已有的.inner-container
并Content should be placed within columns, and only columns may be immediate children of rows.
答案 2 :(得分:0)
从css。{/ p>中移除width: 350px
div中的.package
#service-one .package {
width: auto !important;
}
&#13;
或者在css文件中添加此样式