html css3写一个圆环 缺少一角

html-css018

html css3写一个圆环 缺少一角,第1张

我用两个div写的实现楼主所说效果

.div1 {

width:100px

height:100px

background-color:transparent

border:4px solid red

border-radius:60px

margin-top:20px

}

.div2 {

width:60px

height:60px

background-color:#fff

z-index:1

border-radius:45px

position:absolute

top:0

left:80px

}

还有一个是用HTML5的canvas标签,不过得用JS

<html>

<head>

<title></title>

<style type="text/css">

.content{display: none}

</style>

</head>

<body>

<span>设为终点</span><span>设为起点</span><span>搜索附近</span>

<div class="content">1</div>

<div class="content">2</div>

<div class="content">3</div>

<script>

var _span=document.getElementsByTagName("span")

var _div=document.getElementsByTagName("div")

for (var i = 0,len=_span.lengthi <leni++) {

_span[i].index=_div[i].index=i

_span[i].onclick=function(){

var ind=this.index

if (_div[ind].className=="content") {

for(var j=0j<lenj++){

_div[j].className="content"

}

_div[ind].className=""

}else{

_div[ind].className="content"

}

}

}

</script>

</body>

</html>