![](/img/trans.png)
[英]How to change text in a button on hover with CSS in JS in React
[英]how to write hover in same class in css file for react js
你必須這樣寫
.baseStyle {
/* base styles goes here*/
}
.baseStyle:hover {
/* hover styles goes here */
}
如果你想達到你想要的,你必須使用scss
。
然后它會像
.class {
margin:20px;
&:hover {
color:yellow;
}
}
如果你想寫相同的 class。 你應該使用 Sass/Scss。
使用 .scss 擴展名保存 css 文件。 它是更好語法的預處理器。
參考這個沙箱:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.