gpt4 book ai didi

html - 将文本置于 CSS 预加载器下方

转载 作者:行者123 更新时间:2023-11-28 14:54:50 25 4
gpt4 key购买 nike

我试图在我的 CSS 预加载器下面放置一些文本,上面写着“加载选项 - 这可能需要几秒钟......”

#loader {
border: 16px solid rgba(255, 255, 255, 0.5);
/* Light grey */
border-top: 16px solid rgb(27, 40, 61);
/* Blue */
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
position: absolute;
top: 50%;
margin-top: -60px;
left: 50%;
margin-left: -60px;
}

#loader:after {
content: "Loading Options - This May Take A Few Seconds...";
position: absolute;
bottom: 100%;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
<div id="search-overlay">
<div id="loader"></div>
</div>

但是,这会导致文本随加载器一起旋转,而不是在其下方静态。非常感谢任何帮助!

最佳答案

只需创建一个新元素 :)

将它与更多小的 CSS 结合起来,使它看起来更时髦。

#loader {
border: 16px solid rgba(255, 255, 255, 0.5);
/* Light grey */
border-top: 16px solid rgb(27, 40, 61);
/* Blue */
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
margin-bottom: 10px;
}

#loader:after {
position: absolute;
bottom: 100%;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
#search-overlay {
position: relative;
display: flex;
flex-flow: column wrap;
align-items: center;
justify-content: center;
}

#loader-text {
font-family: sans-serif;
text-align: center;
}
<div id="search-overlay">
<div id="loader"></div>
<div id="loader-text">Loading Options:<br> This may take a few seconds...</div>
</div>

关于html - 将文本置于 CSS 预加载器下方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51147550/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com