嗨,感謝您在這裏的出色工作。我正在爲我的項目使用react.js來構建我的組件,並且現在我感覺有點卡住了我的項目。我正在嘗試使用懸停功能設計一個按鈕,但我不知道如何應用此功能來做出反應。如何在JSX中執行CSS:懸停功能?
下面是代碼:
let button = {
backgroundColor: colorPalette.white,
border: "1px solid rgb(12,106,145)",
color: colorPalette.brandCol1,
textAlign: 'center',
textDecoration: 'none',
fontSize : 'inherit',
fontWeight : 600,
padding : "5px 8px 5px 8px"
}
,我想懸停樣式添加到它,就像我們做的CSS與
button:hover {
style here.......
}
什麼是正確的語法?
在JavaScript中使用React和事件處理函數代替 – Li357
可以提供實際的React代碼嗎? –