我有外div和内div.我需要把内div放在外div的底部.
外部div是弹性的(例如,宽度:70%).我还需要在挡路内侧居中.
所述化妆的简单模型如下图所示:
我有外div和内div.我需要把内div放在外div的底部.
外部div是弹性的(例如,宽度:70%).我还需要在挡路内侧居中.
所述化妆的简单模型如下图所示:
测试并在Firefox 3、Chrome 1和IE 6、7和8上运行:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html><body>
<div style='background-color: yellow; width: 70%;
height: 100px; position: relative;'>
Outer
<div style='background-color: green;
position: absolute; left: 0; width: 100%; bottom: 0;'>
<div style='background-color: magenta; width: 100px;
height: 30px; margin: 0 auto; text-align: center'>
Inner
</div>
</div>
</div>
</body>
</html>