這裏是我的小提琴試圖建立一個靈活的3個按鈕的頁腳
我需要的按鈕集中了位每一個在頁腳周圍填充的定位。
我已經非常接近,但按鈕似乎溢出了頁面的底部?
html, body {
height:100%;
width:100%;
margin:0;
}
div#footer{
width:100%;
height:10%;
bottom:0;
top:90%;
left:0;
background-color:#2A2A2A;
position:fixed;
display:table-cell;
vertical-align:middle;
}
#button {
height : 90%;
width : 30%;
background-color : #FFFFFF;
margin:1.666%;
text-align:center;
float:left;
-webkit-border-radius: 1em;
-moz-border-radius: 1em;
border-radius: 1em;
}
#button:before {
content:'';
height:10%;
vertical-align:middle;
display:inline-block;
}
<div id="footer">
<div id="button">button text</div>
<div id="button">button text</div>
<div id="button">button text</div>
</div>
您不能讓元素共享相同的ID。您應該將這些按鈕ID更改爲類。 ID意味着獨特。 –
哎呀。學校男孩錯誤 – totalitarian
做按鈕需要中心水平和垂直或只是水平?請同時使用 – wf4