【发布时间】:2021-12-09 00:26:47
【问题描述】:
我的主页上的加载程序有问题,我必须使用平板电脑查找桌面版本,网站左右两侧都有空间。 所以我在桌面上使用了 margin : 0 auto 0 auto 。 问题是我的装载机也遵循这个规则,它不再在中心,我试图给它一个边距:0 但不起作用,我也试图给一个负边距,它在移动但它是不是很敏感。。 如果您有任何解决方案,我将不胜感激! 我会提供一些图片以便您更容易理解:
.chargement {
width: 100%;
height: 100%;
position: absolute;
animation-name: loading;
animation-duration: 2.5s;
animation-fill-mode: forwards;
}
.chargement_bloc {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.chargement_bloc-cercle {
width: 130px;
height: 130px;
border-radius: 100%;
border: 20px solid #fff;
border-right-color: transparent;
animation-name: circle;
animation-duration: 2.5s;
animation-timing-function: ease-in-out;
visibility: hidden;
}
@keyframes circle {
0% {
visibility: visible;
transform: rotate(0deg);
}
99% {
visibility: visible;
transform: rotate(1500deg);
}
100% {
z-index: -1;
visibility: hidden;
}
}
@keyframes loading {
0% {
background-color: #9356DC;
z-index: 1;
}
99% {
z-index: 1;
background-color: #9356DC;
}
100% {
z-index: -1;
visibility: hidden;
}
}
html {
width: 100%;
}
body {
margin: 0;
}
@media (min-width: 993px) {
body {
width: 993px;
margin: 0 auto 0 auto;
background-color: #5D5D5D;
}
}
<body>
<!-- Barre de chargement -->
<div class="chargement">
<div class="chargement_bloc">
<div class="chargement_bloc-cercle"></div>
</div>
</div>
</body>
【问题讨论】:
标签: html css media-queries css-animations margin