我有一些集装箱,他们的子女只能是绝对的/相对的位置。 如何确定集装箱的高度,使其子女在集装箱内生活?
Here s the code:
<><><><>>><>>>>><>>>>>>
<section id="foo">
<header>Foo</header>
<article>
<div class="one"></div>
<div class="two"></div>
</article>
</section>
<div style="clear:both">Clear won t do.</div>
<!-- I want to have a gap between sections here -->
<section id="bar">
<header>bar</header>
<article>
<div class="one"></div>
<div></div>
<div class="two"></div>
</article>
</section>
CSS
article {
position: relative;
}
.one {
position: absolute;
top: 10px;
left: 10px;
background: red;
width: 30px;
height: 30px;
}
.two {
position: absolute;
top: 10px;
right: 10px;
background: blue;
width: 30px;
height: 30px;
}
这里是一片 j。 我希望“禁运”案文在4平方米之间出现,而不是放在后面。
Any easy fixes?
Note that I don t know the height of these children, and I can t set height: xxx for containers.