【发布时间】:2022-01-21 20:03:53
【问题描述】:
有没有人知道如何将标记内的数字居中?这是目前的情况。
创建标记
return L.divIcon({
className: "green-icon",
iconSize: [25, 41],
iconAnchor: [10, 44],
popupAnchor: [3, -40],
html: markerNumber,
});
CSS
.green-icon {
background-image: url("../GreenIcon.png");
background-repeat: no-repeat;
margin: 0 auto;
text-align: center;
color: white;
font-weight: bold;
}
【问题讨论】:
标签: javascript css reactjs leaflet react-leaflet