我的问题是我想要一组并排的div。这些div可以增长到任意高度,因此垂直对齐很重要。正如另一个SO帖子所建议的,为了解决垂直对齐问题,我有一个类似于此的结构。请帮我填空。在浏览器中如何使用一个剩余空间的并排Div?
<div id="main-container">
<div class="formatter">
<div class="content1">
<!--- I am fixed at 200px ---->
</div>
</div>
<div class="formatter">
<div class="content2">
<!--- I have a rendered element. I don't know exactly how high or wide I am, but I'm not going to take up the whole thing. --->
</div>
</div>
<div class="formatter">
<div class="content3">
<!--- I have some text and just want to take up the rest of the main container less padding and borders ----->
</div>
</div>
</div>
显示:
CSS:
#main-container {
width: 900px;
}
.formatter {
display: inline-block;
vertical-align: middle;
}
.content1 {
float: left;
width: 200px;
}
我想我一定错过了你问题的一部分,你告诉我们问题是什么...... –
没问题,但当我们不知道问题是什么时,很难提供帮助。哦,你知道吗,如果你不想要前端工作,我可以看看你,我的咨询率是合理的竞争...;) –
也许试着找到一些两列的布局。 (我敢肯定,你可以找到更多这些,而不是你的问题的确切答案。)然后你做了一个两列的布局,其中左列是固定的宽度,右边是剩下的空间。如果你得到这个工作,那么也许你可以再次做同样的事情 - 只有这一次你在左栏内发生同样的事情。所以你有: '|固定|内容... |' 之后 '| fixed | ... |内容... |' 这可能工作,取决于你会找到什么样的解决方案。 –