我已经使用bootstrap列来设置布局,就像新的业务概念的仪表板一样。我有一些进度条位于一个div内,但是如果没有第五个条跳出div,那么尝试顺序和适合五个条很难。我喜欢堆放在div中的酒吧,标签位于酒吧的顶部或旁边。你能帮忙吗? PS。 id只是用于更改进度条的长度。
栏的代码是:
.container-for-bar{
border:1px solid gray;
height:12px;
width:100px;
padding:1px;
display: inline-block;
}
.bar{
background-color: purple;
width:50%; /*change this for progress*/
height: 100%;
}
.bar-text {
display:inline-block;
font-size: 12px;
}
.bar-text-top {
font-size: 12px;
}
.progress-bar-purple {
background-color: purple;
color: black;
}
/* Bootstrap progress bars*/
.progress-bar-text {
float: left; text-align: center;
padding-left: 2px;
}
.half-unit {
margin-bottom: 20px;
padding-bottom: 4px;
border: 1px solid #383737;
background-image:url('../img/sep-half.html');
background-color: #D8D8D8;
color:black;
height:130px;
padding: 5px;
}
.tipi {
}
.purple {
background-color: #5C005C;
color:white;
}
.half-unit:hover {
background-color: #4f4f4f;
-moz-box-shadow: 3px 3px 2px 0px #151515;
-webkit-box-shadow: 3px 3px 2px 0px #151515;
box-shadow: 3px 3px 2px 0px #151515;
}
.half-unit dtitle {
font-size:10px;
text-transform:uppercase;
color:#000000000000;
margin:0px;
padding:0px;
height:inherit
}
.half-unit hr {
border: 0;
border-top: 1px solid #151515;
border-top-style: dashed;
margin-top:0px;
}
.half-unit h1 {
font-family: 'Raleway', sans-serif;
font-weight:300;
font-size: 20px;
line-height: 1;
letter-spacing: 0px;
color: #000000000000;
padding-top:10px;
padding-left:5px;
margin-top:2px;
text-align:center;
}
.half-unit h4 {
padding-left:5px;
margin-top:2px;
font-size: 13px;
font-weight:lighter;
line-height: 1;
letter-spacing: 0px;
color: #000000;
}
.half-unit bold{
font-family: 'Open Sans', sans-serif;
font-size:26px;
font-weight:bold;
color:#000000;
vertical-align:middle;
}
.green {
background-color: 'green';
}

<div class="col-sm-3 col-lg-3">
<div class="half-unit tipi">
<dtitle>T.I.P.I</dtitle>
<hr>
<div class="col-sm-6">
<div class="bar-text-top"> Extroversion </div>
<div class="container-for-bar">
<div class="bar" id="Extroversion_bar"></div>
</div>
<div class="bar-text-top"> Conscientiousness </div>
<div class="container-for-bar">
<div class="bar" id="Conscientiousness_bar"></div>
</div>
</div>
<div class="col-sm-6">
<div class="bar-text"> Agreeableness </div>
<div class="container-for-bar">
<div class="bar" id="Agreeableness_bar"></div>
</div>
<div class="bar-text"> Calmness </div>
<div class="container-for-bar">
<div class="bar" id="Calmness_bar"></div>
</div>
<div class="bar-text"> Openess </div>
<div class="container-for-bar">
<div class="bar" id="Openess_bar"></div>
</div>
</div>
</div>
&#13;
答案 0 :(得分:0)
我分成行然后是列,这似乎有效。