私のページの最後の祖先 div には、パネル効果を与えるために、4 つの側面すべてに余白が必要です。これが私のコードです:
CSS:
html, body {
height: 100%;
}
#wrapper {
width: 100%;
height: 100%;
}
#bibletree {
width: 20%;
float: left;
height: 100%;
}
.inner { /*this is the div that I need a margin around, so it is by 10px of the #bibletree div on all sides, including the bottom.*/
overflow: auto;
}
HTML:
<div id="wrapper">
<div id="bibletree">
<div class="inner">my content here, both short and long</div>
</div>
</div>
おそらくご想像のとおり、ここに書かれていることよりも多くのことが行われています。divのパネル効果のためにすべてこのマージンが必要な div を持ついくつかの列があります.inner
。助けてくれてありがとう。
ところで、絶対配置を試してみましたが、親を に設定しても、親要素ではなく、ウィンドウに基づいてのみ配置されposition: relative
ます。