【发布时间】:2021-07-29 21:53:01
【问题描述】:
我已经实现了允许查看用户是否在线的 CSS 状态:
这是 CSS 代码:
.status-circle-online {
width: 20px;
height: 20px;
border-radius: 50%;
background-color: rgb(255, 60, 0);
border: 2px solid white;
bottom: 10px;
right: 10px;
position: absolute;
}
这是html代码:
<div>
<img
src={profileImageSrc}
className="rounded-circle ml-3"
/>
<div
className={`status-circle-${online_or_offline_signal} cursor-pointer`}
/>
</div>
知道如何让它“粘”在图像上吗?
【问题讨论】:
-
位置:相对于其父级
标签: html css reactjs bootstrap-4 sass