html - Html 项目符号未按预期出现
问题描述
我想在 Angular 8 中使用 html 和 css 实现以下屏幕
所以,my-component.html
文件如下所示:
<div class="uptime-container">
<ul *ngFor="let data of chartData">
<li [ngClass]="{'my-class li-text': data.status === 'red', 'my-class2 li-text':data.status === 'green' }">{{data.node}}</li> <p class="right-text">{{data.duration}}</p>
<hr>
</ul>
</div>
并且my-component.scss
如下图所示:
ul {
list-style: none;
width:70%;
}
.right-text{
float: right;
margin-top: -35px;
font-size: 15px;
}
.li-text{
font-size: 15px;
margin-top: -35px;
}
hr {
width:100%;
margin-right: 57%;
}
ul li.my-class::before{
color: red;
content: "•";
font-size: 50px; /* or whatever */
font-weight: bold;
display: inline-block;
width: 1rem;
margin-left: 0em;
padding-right:20px;
// margin-bottom: -5px;
}
ul li.my-class2::before{
color: green;
content: "•";
font-size: 50px; /* or whatever */
font-weight: bold;
display: inline-block;
width: 1rem;
margin-left: 0em;
padding-right:20px;
// margin-bottom: -5px;
}
.uptime-container{
background-color: white;
width: 50%;
margin-left: 20px;
margin-top: 20px;
}
所以,我当前的输出如下图所示:
子弹显示为方形而不是圆形。我不确定我哪里出错了。
解决方案
推荐阅读
- angular - Angular 9 Mat 表格编辑选择单元格并绑定数据
- linux - Bash Shell While inside for loop not working-只选择第一个值
- python-3.x - 将python数据框转换为正确的行列格式
- ios - 获取“在执行本机代码时获得 segv”
- javascript - 显示错误响应时 *ngFor 中的 *ngIf 未定义错误
- java - Spring-Boot Maven,缺少依赖项@RestController
- android - 未经检查的警告 - 在编译期间使用 Safe Args 传递数据
- surge.sh - 浪涌未被识别为内部或外部命令
- sql - 在 SQL 中聚合
- autodesk-forge - 无法通过 Forge 的 .svf 网格查看自定义网格