【发布时间】:2015-07-14 22:58:56
【问题描述】:
我正在尝试使用 CSS 和 HTML 创建一个圆形方向箭头。以下是我的尝试。
Attempt 1
在此我旋转了<div> 和一个箭头,但两者的位置不同。
这是 CSS:
#curves div {
width: 100px;
height: 100px;
border: 5px solid #999;
}
#curves.width div {
border-color: transparent transparent transparent #999;
}
#curve1 {
-moz-border-radius: 50px 0 0 50px;
border-radius: 50px 0 0 50px;
}
.arrow-right {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-left: 27px solid #ccc;
float: right;
margin-top: -7px;
margin-right: -26px;
}
<div id="curves" class="width">
<div id="curve1"></div><span class="arrow-right"></span>
</div>
Attempt 2
我创建的箭头是直的。
.container {
width: 60%;
height: 9px;
background: #ccc;
margin: 100px auto;
-moz-border-radius: 50px 0 0 50px;
border-radius: 50px 0 0 50px;
}
.arrow-right {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-left: 27px solid #ccc;
float: right;
margin-top: -7px;
margin-right: -26px;
}
<div class="container">
</span><span class="arrow-right"></span>
</div>
更新 我想要这样的东西
【问题讨论】:
-
嗯...它实际上并不是真正的 HTML 代码,但也许您可以使用 SVG 标签找到您想要的内容(这里是一个 SVG 抽屉:svg-edit.googlecode.com/svn/trunk/editor/svg-editor.html#group。您可以通过单击垂直
SVG按钮,只需复制/粘贴即可。) -
它看起来像是 SVG 或图标字体的工作,而不是 CSS。
-
我不是在质疑你问你有什么的理由......我很好奇你需要这个而不是像fortawesome.github.io/Font-Awesome/icons这样简单的图标字体的场景/跨度>
-
我不想使用任何图像。这就是为什么。
标签: html css css-shapes