同一行3类
我想根据下面的每个点的颜色提供解释。
我的Spesific领域的HTML代码:
<div class="dot-expl">
<div class ="dot dot-red">Ended</div>
<div class ="dot dot-green">Running</div>
<div class ="dot dot-yellow">Ready to start</div>
</div>
我的整个CSS代码:
.dot-expl{
display: flex;
align-items: center;
overflow:visible;
}
.dot {
height: 20px;
width: 20px;
border-radius: 50%;
display: inline-block;
}
.dot-red {
background-color: red;
}
.dot-green {
background-color: green;
}
.dot-yellow {
background-color: yellow;
}
我找不到如何在点之间提供更多空间,因为可以看到文本
I want to give an explanation based on color of each dot below.
My HTML code for the spesific area:
<div class="dot-expl">
<div class ="dot dot-red">Ended</div>
<div class ="dot dot-green">Running</div>
<div class ="dot dot-yellow">Ready to start</div>
</div>
My whole CSS code:
.dot-expl{
display: flex;
align-items: center;
overflow:visible;
}
.dot {
height: 20px;
width: 20px;
border-radius: 50%;
display: inline-block;
}
.dot-red {
background-color: red;
}
.dot-green {
background-color: green;
}
.dot-yellow {
background-color: yellow;
}
I cannot find how to give more space between the dots as so as the text can be visible
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过使用pseudo class
::
使用这种方法来完成此方法
我为每个
dot
设置了一个边距(左)(左),以在单个元素之间具有一定的空间。您还可以给包装器一个固定宽度,并在包装器上使用
josify-content
。但是我认为这会让您遇到其他问题,具体取决于文本的长度。You could do it with this approach by using the pseudo class
::before
I set a margin to each
.dot
on both sides (left & right) to have some space between the individual elements.You could also give your wrapper a fixed width and use
justify-content
on the wrapper. But I assume this will make you run into other problems depending on the length of the text.