自行调整大小的 div 故障排除

Troubleshooting divs that have resized on their own

我目前正在构建一个 div 网格布局网页。很明显我一直在编辑每个individual square来填补一个角色。然而,出于某种原因,我注意到尽管我已将大部分 div 指定为 200x200px,并且出于某种原因将一对 200x400px 指定为 200x400px,但其中一些已通过额外的 [= 调整大小13=] 所以正方形开始重叠。我以前没有这个问题,但我现在有。有人可以解决这个问题吗?因为我看不到问题。

问题出在 'steps' div 和 'special offers' div 中,背景也已调整为一半大小。 Here is a livelink to the page in question, please look at the source code. I shall remove this when the question is answered for future posterity of the post.

这是HTML:

<div class="col">
    <div class="trigger">
        <div style="display:table-cell; vertical-align:middle; color: white;" tabindex="0" class="maincontent hover-img img4"><img src="STEP1.jpg" height="200" width="200"/><p style="margin: 10px 20px;">Fill out our order form choosing the service you require and your payment details. We will then take a deposit and book you into our diary.<p></div>
    </div>
    <div class="trigger">
        <div style="display:table-cell; vertical-align:middle; color: white;" tabindex="0" class="maincontent hover-img img4"><img src="STEP3.jpg" height="200" width="200"/><p style="margin: 10px 20px;">We will produce the work you require using the project plan. All of our work is produced Within the time limit set and to the highest possible standard.<p></div>
    </div>
</div>
<div class="col">
    <div class="trigger">
        <div style="display:table-cell; vertical-align:middle; color: white;" tabindex="0" class="maincontent hover-img img4"><img src="STEP2.jpg" height="200" width="200"/><p style="margin: 10px 20px;">We will have a face to face meeting to discuss everything that you require and we will put together a project plan.<p></div>
    </div>
    <div class="trigger">
        <div style="display:table-cell; vertical-align:middle; color: white;" tabindex="0" class="maincontent hover-img img4"><img src="STEP4.jpg" height="200" width="200"/><p style="margin: 10px 20px;">A design is not finished until you are entirely happy. When we believe the work is complete we will send you an artwork approval form for you to sign and return.<p></div>
    </div>
</div>

如果您为 .trigger 使用填充,请添加 box-sizing: box-border; 属性。

如需更详细的帮助,post 您的 css 并修复实时 link,因为它会带来您自己拥有的本地文件!

应用这个css

.trigger {
  width: 200px;
  height: 200px;
  overflow: hidden;
  box-sizing: border-box;
}