如何使按鈕同時位於div底部和中間?div中間和底部的按鈕
這裏是我的代碼: http://jsfiddle.net/3QguR/1/
HTML
<div class='Center' align='center'>
<button class='btn-bot'>button-bottom</button>
</div>
CSS
.Center{
width:200px;
height:200px;
background:#0088cc;
margin:auto;
padding:0%;
position: relative;
top: 0; left: 0; bottom: 0; right: 0;
border-radius:5%;
}
.btn-bot{
position: absolute;
bottom: 0;
}
http://jsfiddle.net/3QguR/3/ – Petah
您不應該使用'align'作爲'div'的屬性。在HTML5中,此屬性在div標記中已過時:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div 改爲使用css'text-align:center;'。 – 3dgoo
http://stackoverflow.com/questions/5817233/align-button-at-the-bottom-of-div-using-css是你正在尋找的答案 – mmcrae