sass - Angular - 显示字体真棒微调中心不起作用
问题描述
我正在尝试在水平中心显示一个很棒的字体微调器。使用下面的 CSS,它仅显示在左侧。谁能帮我解决这个问题?
加载.component.html
<div class="container">
<div class="loading-overlay">
<i class="fa fa-spinner fa-spin fa-4x"></i>
</div>
</div>
加载.component.scss
.loading-overlay {
align-items: center;
display: flex;
justify-content: center;
position: absolute;
z-index: 2;
}
.container {
width: 100%;
}
谢谢
解决方案
删除position: absolute;
,你很好。
.loading-overlay {
align-items: center;
display: flex;
justify-content: center;
z-index: 2;
}
.container {
width: 100%;
}
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.10.0/css/all.css" integrity="sha384-AYmEC3Yw5cVb3ZcuHtOA93w35dYTsvhLPVnYs9eStHfGJvOvKxVfELGroGkvsg+p" crossorigin="anonymous" />
<div class="container">
<div class="loading-overlay">
<i class="fa fa-spinner fa-spin fa-4x"></i>
</div>
</div>
推荐阅读
- java - 来自 Java 代码的 Intellij 自定义语言插件参考
- javascript - 在javascript中处理跨模块的相对路径
- azure - 多个 Runbook 可以在 Azure 自动化帐户中同时运行吗?
- c - 以前的值仍然存储在 do while 循环的下一次迭代中
- batch-file - 如何在 .bat 脚本中获取正在运行的 cmd 窗口日志
- python - 在 DoE 期间重置每个输入之间的所有变量以进行多学科分析
- mysql - 同一张表上多对多关系的内部联接
- swift - 尝试在本地网络下加载 https 网页时,WKWebView 显示空白页面
- spring - 跨区域事件路由和 Spring Cloud Stream & Spring Cloud Data Flow
- python - python whl包没有考虑模块内引用