gpt4 book ai didi

html - 将圆圈移至 font Awesome Bell 的右上角

转载 作者:行者123 更新时间:2023-12-02 04:04:51 24 4
gpt4 key购买 nike

我有一个字体很棒的铃铛,我正在尝试让铃铛出现在铃铛的右上角。这是我想要在 Paint.NET 中制作的示例 https://gyazo.com/2d74f611e2df81362bc3f2e946f9d747

这是我迄今为止尝试过的:

.notification {
background: red;
border-radius: 50%;
border: 1px solid red;
height: 8px;
width: 8px;
position: relative;
}
<i class='fa fa-bell notification'></i>

但这会将铃放在左侧。我尝试过:之前但它只是让它消失了。

提前谢谢您。

最佳答案

position: relative;<i> -tag,然后在 CSS 中添加:

.notification:after {
content: "";
display: block;
position: absolute;
width: 8px;
height: 8px;
background: red;
top: 0;
right: 0;
border-radius: 50%;
}

关于html - 将圆圈移至 font Awesome Bell 的右上角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39985252/

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