繁体   English   中英

Angular 如何在 mat-icon 上添加文本

[英]Angular How to add text on top of mat-icon

考虑这个 html:

 <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/> <mat-icon class="fa fa-folder" style="font-size:48px;"><span style="color: red; font-size: 30px">P</span></mat-icon>

这会导致文件夹图标和旁边的 P文本

是否可以在文件夹图标顶部放置 P文本

使用下面的代码

 <mat-icon class="fa fa-folder" style="font-size:48px;"></mat-icon> <div style="color: red; font-weight: bold; font-size: 24px; margin-top:-1px; margin-left:15px">P</div>

这就是我一直在寻找的:

 <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/> <mat-icon class="fa fa-folder" style="font-size:40px; color: black"> <span style="color: red; font-weight: bold; font-size: 30px; margin-right: 12px; display:block; margin-top: -35px; margin-left: 10px">P</span> </mat-icon>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM