【发布时间】:2019-10-16 22:19:23
【问题描述】:
我遇到了一些问题,我似乎无法弄清楚。
我正在尝试创建一个按钮并在其底部添加一个引导进度条,但我似乎无法弄清楚如何让它做到这一点。
这是我目前的设置。 https://jsfiddle.net/bob_mosh/7qeazm9w/3/
HTML:
<button id="sample_button" type="button" class="soundButton">
<label class="buttonTitle">Bird Song</label>
<label class="buttonDescription">A nice bird song.</label>
<div class="progress volume-slider">
<div class="progress-bar" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</button>
CSS:
.soundButton {
display: table-cell;
background-color: rgba(255, 255, 255, 0.650);
margin: 4px;
padding: 8px;
width: 250px;
height: 120px !important;
border-radius: 8px;
border: none !important;
float: left !important;
}
.soundButton label {
color: rgba(37, 38, 43, 1.00) !important;
}
body {
background-color: rgba(37, 38, 43, 1.00)
}
.buttonTitle {
font-weight: 700;
font-size: 1.5em;
display: block;
}
.volume-slider {
bottom:0;
height: 8px !important;
}
由于某种原因,我无法使用绝对定位。每次我尝试将进度条的位置设置为绝对时,它都会完全消失。谁能帮我解决这个问题?
【问题讨论】:
-
您希望进度条出现在按钮下方和按钮结构之外吗?
-
jsfiddle.net/ulric_469/tz4f5m38/2 你期待以上结果吗?
-
对不起,我没有完全清楚那里,我希望按钮位于按钮的底部边缘,而不是按钮之外。
-
去掉按钮的内边距,只为文本设置内边距
-
jsfiddle.net/ulric_469/y6x18ogw/1 看看是不是预期的结果?
标签: html css bootstrap-4 vertical-alignment