我的 React 项目中有一个按钮,我是这样设置的。
样式设置是这样的
label : {
borderRadius: '1vh',
cursor: 'pointer',
height: '2.5vh',
margin: '0.5vh',
minWidth: '50px',
fontSize: '1.7vh',
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
flexDirection: 'row',
backgroundColor : 'green',
color : 'black',
opacity : '0.9',
'&:hover': {
backgroundColor : 'green',
color : 'black',
opacity : '1',
},
},
input : {
zIndex : -1,
position : 'absolute',
opacity : 0,
visibility : 'hidden',
}
当鼠标悬停在标签上时,悬停样式不会激活,我不确定我在这里做错了什么。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号