2014-09-22 51 views
0

我想標籤顏色的寬度定義爲百分比。在那裏的任何css專家都知道我想要的是否真的可以實現?Bootstrap標籤作爲進度條

// Bootstrap label css: 

.label { 
    display: inline; 
    padding: .2em .6em .3em; 
    font-size: 75%; 
    font-weight: bold; 
    line-height: 1; 
    color: #fff; 
    text-align: center; 
    white-space: nowrap; 
    vertical-align: baseline; 
    border-radius: .25em 
} 
.label-success { 
    background-color: #18bc9c; 
    color: #ffffff; 
} 

// HTML 

<span class="label label-success">games</span> 

我想是這樣的:

enter image description here

+0

使用類似於:http://codepen.io/ericrasch/pen/Irlpm with http://css-tricks.com/html5-progress-element/。結合他們,你應該擁有它! – 2014-09-22 12:34:21

+1

@MadsLundeland有你的嘗試過嗎? SO不是免費的編碼服務。 – easwee 2014-09-22 12:34:44

+0

我嘗試了幾件事,但我無法弄清楚如何處理變量標籤的長度,即長度是由標籤文本決定的。 – 2014-09-22 12:40:13

回答