我将这个CSS用于带有一种边框颜色的圆圈:
m = new MarkerWithLabel({
position: pos,
map: map,
labelContent: txt,
labelAnchor: new google.maps.Point(18, 18),
labelClass: "circle",
icon: "/i/t.png"
});
.circle {
border: 6px solid #ffd511;
border-radius: 30px;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
-khtml-border-radius: 30px;
width: 30px;
height: 18px;
line-height: 20px;
padding: 12px 6px;
text-align: center;
}
<div class="circle">17</div>
看起来像这样:
如何将CSS更改为三种边框颜色 - 与时钟一样:
与上一个问题的answer一样:
svg{width:30%;height:auto;}
<svg viewbox="0 0 10 10">
<defs>
<circle id="circle" cx="5" cy="5" r="4" stroke-width="0.5" fill="transparent" />
</defs>
<use xlink:href="#circle" stroke="pink" stroke-dasharray="0,2.09,8.38,30" />
<use xlink:href="#circle" stroke="green" stroke-dasharray="0,10.47,8.38,30" />
<use xlink:href="#circle" stroke="orange" stroke-dasharray="2.09,16.75,6.3" />
</svg>
必需
圆圈元素是Google Maps API v3中显示的标记,因此我无法使用SVG。
另一种解决方案是使用图像:
.circle {
background: url('circle.png') no-repeat;
width: 58px;
height: 58px;
line-height: 20px;
text-align: center;
}
答案 0 :(得分:0)
答案 1 :(得分:0)