[英]size css element from bottom as a percent of parent
但這與我的代碼完全相反。 CSS元素如何從底部對齊?
HTML:
<div id="skill">
<div><span class="bar nrml"></span>
<span class="bar moderate"></span><span class="bar severe"></span>
</div>
CSS:
#skill {
font: 12px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
height: 200px;
position: relative;
padding: 0px 0;
}
#skill div {
margin-bottom: 0px;
background: #e9e5e2;
width: 1em;
border-radius: 10px;
height: 200px;
}
.bar {
width: 1em;
height: 200px;
margin: 1px 2px;
position: absolute;
border-radius: 10px;
}
.severe {
height: 25%;
background-color: #f674a4;
}
.moderate {
height: 50%;
background-color: #f0bb4b;
}
.nrml {
height: 100%;
background-color: #a1ce5b;
}
您只需要添加bottom:0;
上課.severe
。 這里是一個新的更新小提琴: https : //jsfiddle.net/sebastianbrosch/yoqhkpwh/2/
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.