我有以下几点:
如何去掉蓝色下划线? 代码如下:
<Link to="first"><MenuItem style={{paddingLeft: 13, textDecoration: 'none'}}> Team 1 </MenuItem></Link>
MenuItem组件来自http://www.material-ui.com/#/components/menu
我有以下几点:
如何去掉蓝色下划线? 代码如下:
<Link to="first"><MenuItem style={{paddingLeft: 13, textDecoration: 'none'}}> Team 1 </MenuItem></Link>
MenuItem组件来自http://www.material-ui.com/#/components/menu
当前回答
你可以在你的scss文件中使用这段代码; 这将消除不需要的颜色变化,
a:-webkit-any-link {
&:hover {
color: white;
}
}
其他回答
对我有用的是:
<Link to="/" style={{boxShadow: "none"}}>
a {
text-decoration: none !important;
color: black !important;
font-size: 20px;
}
在App.css中使用
a:-webkit-any-link {
text-decoration: none;
color: inherit;
}
/ / CSS
.navigation_bar > ul > li {
list-style: none;
display: inline;
margin: 2%;
}
.link {
text-decoration: none;
}
.jsx
<div className="navigation_bar">
<ul key="nav">
<li>
<Link className="link" to="/">
Home
</Link>
</li>
</ul>
</div>
看这里-> https://material-ui.com/guides/composition/#button。
这是官方的材质界面指南。也许它对你会像对我一样有用。
然而,在某些情况下,下划线仍然存在,您可能需要使用text-decoration: "none"。为了更简洁的方法,您可以从material-ui/core导入并使用makestyle。
import { makeStyles } from '@material-ui/core';
const useStyles = makeStyles(() => ({
menu-btn: {
textDecoration: 'none',
},
}));
const classes = useStyles();
然后将className属性设置为{classes。menu-btn}在JSX代码中。