我正在尝试制作圆形虚线,但在CSS中却会变成正方形 [英] I am trying to make circular dotted line but I am getting square in css

查看:48
本文介绍了我正在尝试制作圆形虚线,但在CSS中却会变成正方形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上,我正在尝试用CSS制作一条虚线,我希望它以圆形形式出现,但是我得到的是正方形

actually I am trying to make a dotted line with CSS I want it in circular form but I am getting it in square

我正在使用的代码是

hr {border-style: none; border-top-style: dotted; border-color: grey; border-width: 6px; width: 5%; }

我得到的结果是

我想要的结果是

有人可以帮我吗?

推荐答案

您已将其正确放置在代码中.我通过设置 border:none 来撤消< hr/> 的默认边框,从而对其进行了简化.然后,我用 border-top一次设置所有顶部边框的样式:点缀灰色15px :

You have it right in your code. I simplified it a bit by setting border: none to undo the default border of <hr />. Then I set all of the top border's styles at once with border-top: dotted grey 15px:

hr {
  width: 56%;
  border: none;
  border-top: dotted grey 15px;
}

<hr />

这篇关于我正在尝试制作圆形虚线,但在CSS中却会变成正方形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆