我有以下HTML:
<div className={styles.checkBox}>
{((props.itemsWithSelection &&
props.itemsWithSelection?.[key] == 1) ||
(!props.itemsWithSelection &&
invoiceItemsIncluded2[key].defaultValue == 1)) && (
<Check2 className={styles.checked} />
)}
</div>
还有css:
.checkBox {
background-color: #12341b;
top: 30px;
left: 170px;
height: 60px;
width: 60px;
position: absolute;
transition: 0.2s;
z-index: 5;
}
.checked {
color: white;
padding: 10px;
}
在Chrome中,checkmarkicon居中得很好,但在Safari中却没有,为什么?
如果我不使用任何填充物(10px),那么它看起来不错。