從今天起 開始細話div布局 思路及要點: 父div的位置設定成相對的,即“position: relative;”。 而子div的位置設定成 絕對的,并且下邊緣設為0,即“ position: absolute; bottom: 0;”。 代碼
1 <head>
2 <title>子div在父div中置底</title>
3 <style type="text/css">
4 .father { width: 500px; height: 600px; position: relative; background-color: AliceBlue; }
5 .child { width: 400px; height: 100px; position: absolute; bottom: 0; background-color: AntiqueWhite; }
6 </style>
7 </head>
8 <body>
9 <div class="father">
10 <div class="child">
11 </div>
12 </div>
13 </body>
14 </html>
大緻效果
ok 學習要堅持 不要貪多~~~
轉載于:https://www.cnblogs.com/aiqingqing/p/5032091.html