3
我試過這個http://jsfiddle.net/helderdarocha/e4bAh/。但它只是水平居中。這是代碼和的jsfiddle:如何在SVG g元素中居中文本?
<svg width="400" height="400">
<g class="point" transform="translate(225,217)">
<circle></circle>
<text class="pointIndex" y="50">
<tspan text-anchor="middle">10</tspan>
</text>
</g>
</svg>
<style>
.point circle {
cursor: pointer;
text-align: center;
fill: #E2137E;
r: 10;
stroke: #333;
stroke-width: 2px;
}
</style>
如何中心.pointIndex
裏面.point
?
https://jsfiddle.net/alexcheninfo/9a112b63/6/
對不起,我想中心'.point索引不是'.deletePoint'。 – alexchenco
由於有從1到10的數字。我需要找到一個以像素爲中心的非像素方式。 – alexchenco
無法在地圖上找到'.pointIndex',一定是我的眼睛 –