我想重疊2個按鈕(一個是圓圈,另一個是正常按鈕)。這可以使用下面的CSS來實現。但是,我面臨另一個問題,它不響應。我想連續添加4個按鈕(2個圓圈和2個正常)。Boostrap按鈕覆蓋
而且放置在這些按鈕之後的任何元素定位不正確。即如果我在div中放置新文本,文本會覆蓋在這些按鈕上。
我該如何避免這種情況?以及如何使這種響應?
@import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
.btn-circle {
width: 30px;
height: 30px;
text-align: center;
padding: 6px 0;
font-size: 12px;
line-height: 1.428571429;
border-radius: 15px;
}
.btn-circle.btn-xl {
width: 70px;
height: 70px;
padding: 10px 16px;
font-size: 24px;
line-height: 1.33;
border-radius: 35px;
border-width: thick;
background-color: darkgrey;
color: white;
}
/*Image overlay*/
.container_row {
position: relative;
}
.background-layer {
position: absolute;
z-index: 1;
left: 50px;
top: 10px;
height: 50px;
}
.foreground-layer {
position: absolute;
z-index: 2;
left: 0;
top: 0;
height: 50px;
}
.btn-lg-overlay {
width: 300px;
height: 50px;
border-color: lightgrey;
border-width: 5px;
background-color: darkgray;
}
<div class="container_row">
<div class="foreground-layer">
<button type="button" class="btn btn-default btn-circle btn-xl"><i class="glyphicon glyphicon-ok"></i></button>
</div>
<div class="background-layer">
<button type="button" class="btn btn-default btn-lg btn-lg-overlay"><i>Requested</i></button>
</div>
</div>