reactjs - Material-ui Typography with router link always underlined

标签 reactjs react-router material-ui

当我将 React-Router 链接添加到 Typography 元素时,我似乎无法摆脱下划线,即使 underline="none""hover"被选中。

来自 useStyles:

title: {
    display: "none",
    [theme.breakpoints.up("sm")]: {
      display: "block",
    },
  },

来自渲染(Typography 元素在工具栏中,不确定这是否有所不同):

          <Typography
            className={classes.title}
            variant="h6"
            noWrap
            component={Link}
            to="/"
            color="textPrimary"
            underline="none"
          >
            Your Text Here
          </Typography>

在浏览器中: enter image description here

最佳答案

您需要在链接 CSS 中指定以下内容:

textDecoration: "none",
boxShadow: "none"

关于reactjs - Material-ui Typography with router link always underlined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66554678/

相关文章:

css - 无法更改 Material ui中文本字段的字体大小

reactjs - 如何在material ui select中显示renderValue以外的值

reactjs - 如何将数组中的4个元素(对象)添加到本地存储, react

javascript - 动态 JSX 元素/标签名称

javascript - React Router <Router> 历史属性传入的内容是什么?

javascript - React Router 在后退按钮上重复路由

reactjs - useEffect 重新渲染太多次

javascript - React 路由器不显示浏览器历史记录

javascript - 如何使用React前端和express后端从url获取参数?

reactjs - 除 Box 外,对 Material-ui 组件使用样式函数