为什么CSS中未激活“内容”?

问题描述

在react CSS HeaderLink const中,我想在使用鼠标悬停时设计带有下划线效果链接,但是刚发生的事情是单词变成红色并禁止内容。如何解决

const HeaderLink = props => {return (
<Link
  css={{
    fontSize: "0.9rem",fontWeight: 300,color: theme.colors.lightText,letterSpacing: 0.5,transition: "all 200ms ease-in","&:after": {
      position: "absolute",width: "0%",content: ".",color: "transparent",background: "red",height: "1px",transition: "all 0.4s ease-in",},"&:hover": {
      color: "#ec2024","&::after": {
        width: "100%",}}
  {...props}
>
</Link >

) }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)