【发布时间】:2020-07-17 17:33:29
【问题描述】:
我试图根据屏幕大小将列表分成 2 行,因为在较小的屏幕上,信息未正确显示(A、B、C... 只是虚拟信息;真实信息包含在表示州)你可以在图片上看到吗
我的 html 中有这段代码
.card {
z-index: 0;
background-color: #ECEFF1;
padding-bottom: 20px;
margin-top: 30px;
margin-bottom: 30px;
margin-left: 30px;
margin-right: 30px;
border-radius: 10px;
}
.top {
padding-top: 40px;
padding-left: 13% !important;
padding-right: 13% !important
}
#progressbar {
margin-bottom: 30px;
overflow: hidden;
color: #455A64;
padding-left: 0px;
margin-top: 30px
}
#progressbar .text {
font-size: 15px;
font-weight: bold;
margin-top: 10px;
}
#progressbar li {
list-style-type: none;
font-size: 13px;
width: 16.6%;
float: left;
position: relative;
font-weight: 400
}
#progressbar .step0:before {
font-family: "Material Icons";
content: "\e14c";
color: #fff
}
#progressbar li:before {
width: 40px;
height: 40px;
line-height: 45px;
display: block;
font-size: 20px;
background: #C5CAE9;
border-radius: 50%;
margin: auto;
padding: 0px
}
#progressbar li:after {
content: '';
width: 100%;
height: 12px;
background: #C5CAE9;
position: absolute;
left: 0;
top: 16px;
z-index: -1
}
#progressbar li:last-child:after {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
position: absolute;
left: -50%
}
#progressbar li:nth-child(2):after,
#progressbar li:nth-child(3):after,
#progressbar li:nth-child(4):after,
#progressbar li:nth-child(5):after,
#progressbar li:nth-child(6):after {
left: -50%
}
#progressbar li:first-child:after {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
position: absolute;
left: 50%
}
#progressbar li:last-child:after {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px
}
#progressbar li:first-child:after {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px
}
#progressbar li.active:before,
#progressbar li.active:after {
background: #1678e9
}
#progressbar li.active:before {
font-family: "Material Icons";
content: "\e876"
}
<div class="card">
<div class="row d-flex px-3 justify-content-center top">
<div class="d-flex justify-content-center text-center">
<h5>Consulta <span class="text-primary font-weight-bold">#6152</span></h5>
</div>
</div>
<div class="row d-flex justify-content-center">
<div class="col-12">
<ul id="progressbar" class="text-center">
<li [ngClass]="estado >= 1 ? 'active step0' : 'step0'">
<div class="text">A</div>
</li>
<li [ngClass]="estado >= 2 ? 'active step0' : 'step0'">
<div class="text">B</div>
</li>
<li [ngClass]="estado >= 3 ? 'active step0' : 'step0'">
<div class="text">C</div>
</li>
<li [ngClass]="estado >= 4 ? 'active step0' : 'step0'">
<div class="text">D</div>
</li>
<li [ngClass]="estado >= 5 ? 'active step0' : 'step0'">
<div class="text">E</div>
</li>
<li [ngClass]="estado >= 6 ? 'active step0' : 'step0'">
<div class="text">F</div>
</li>
</ul>
</div>
</div>
</div>
我该如何解决这个问题?我已经尝试使用引导网格,但我无法解决这个问题。我还将列表分成 2 份,但我想这不是最好的解决方案,因为在更宽的屏幕上它仍然是分开的。
如果我想要做/拥有的事情有更好、更简单的解决方案,我想知道。提前致谢
UPDATE1:我解决了在“#progessbar .text”上将自动换行分配给正常的文本问题
【问题讨论】:
-
不确定这是否能彻底解决您的问题,但如果您使用
list-inline类呢? (getbootstrap.com/docs/3.3/css/#inline) 在ul -
我正在阅读它,但正如我对@95faf8e76605e973 所说的那样,我仍在迈出进入 html 和 css 的第一步。每次我尝试改变某些东西时,它都会变得更糟,哈哈
标签: html css angular-ui-bootstrap