我已经看到一些类似的问题,但没有真正全面的解决这个特定问题;如果有关于此的一个好线索,我不知何故错过了,我提前道歉。获取表格以正确地与其他divs进行堆叠
所以我有一个多部分问题,我的第一部分的解决方案创建了第二个问题。
我有一个4列布局,其中的内容需要均匀地保持在同一高度,这样的事情:
第二个和第四个盒子里将有一个背景颜色和高度需求保持在与其他两个相同的高度,这将是图像。目前我能找到实现这一目标的最可靠的方法是将其标记如表和单元格高度设置为100%,像这样:
<table>
<tbody>
<tr>
<td style="width: 25%;">
<figure><img alt="" class="img-responsive" src="http://lorempixel.com/1000/1000/business" /></figure>
</td>
<td class="bg-brand-dark" style="height: 100%; width: 25%;">
<div class="block-padding-hor">
<h3 class="text-inverse h6"><strong>Featured Corporate News</strong></h3>
<hr class="rule-part--bright center-block" />
<p class="text-inverse h6">Hardly Dude, a new 'vette? The kid's still got, oh, 96 to 97 thousand, depending on the options.</p>
<p class="text-center"><a class="currentURL" href="">Continue Reading</a></p>
</div>
</td>
<td style="width: 25%;">
<figure><img alt="" class="img-responsive" src="http://lorempixel.com/1000/1000/business" /></figure>
</td>
<td class="bg-gray-dark" style="height: 100%; width: 25%;">
<div class="block-padding-hor">
<h3 class="text-inverse h6"><strong>Featured Corporate News</strong></h3>
<hr class="rule-part--bright center-block" />
<p class="text-inverse h6">Hardly Dude, a new 'vette? The kid's still got, oh, 96 to 97 thousand, depending on the options.</p>
<p class="text-center"><a class="currentURL" href="">Continue Reading</a></p>
</div>
</td>
</tr>
</tbody>
</table>
这解决了我的第一个问题非常好,但创造一个新的。我添加此标记下的任何后续内容被“侵占”,由台上面,像这样(“不希望”是什么目前发生的事情):
所以我的问题是,是否有一个良好的可靠的方法来减轻这一点?我只是假设一个表的行为类似于一个块元素并相应地堆栈,但这似乎并不是这种情况。提前感谢您提供任何建议,即使这是一个不必要的苛刻词汇,并附带一个解决此问题的预先存在的线索。
::编辑::
我并没有包括任何CSS的,因为它是不可能任何它正在对这个产生影响,但如果它似乎有必要了解这个问题只是评论,我会加它
::编辑2 ::
每请求,在这里添加CSS不过,就像我说的,它大多只是设置背景颜色和居中的事情:
<style>
.img-responsive {
max-width: 100%;
}
.bg-brand-dark {
background-color: #004892;
}
.block-padding-hor {
padding-left: 30px;
padding-right: 30px;
}
.rule-part--bright {
border: 2px solid #08b5fe;
width: 50%;
}
.center-block {
margin: 0 auto;
}
.text-inverse {
color: #ffffff;
}
.h6 {
font-size: 13px;
}
.text-center {
text-align: center;
}
.bg-gray-dark {
background-color: #4D4F53;
}
</style>
是的,需要CSS来更好地理解它。 – divy3993
是的,我只是想说“请不要发布任何CSS!让我们猜!” –
这是我可以看到你的问题https://jsbin.com/rijomi/edit?html,css,js,output。 PS:你为什么会用