我有以下几点:
如何去掉蓝色下划线? 代码如下:
<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
当前回答
style={{ backgroundImage: "none" }}
只有这对我有用
其他回答
style={{ backgroundImage: "none" }}
只有这对我有用
下划线默认来自react-router-dom包。您可以执行以下操作来修复此问题。
<Link to="/route-path" style={{ textDecoration: 'none' }}>
// Rest of the code
</Link>
<Link to="/page">
<Box sx={{ display: 'inline-block' }}>
<PLink variant="primary">Page</PLink>
</Box>
</Link>
在某些情况下,当在Gatsby <Link>组件中使用另一个组件时,在内部组件周围添加带有display: 'inline-block'的div,可以防止下划线(在示例中为'Page')。
我只是加了两行,就为我工作了:)
{
text-decoration: none;
color: black;
}
a:-webkit-any-link {
text-decoration: none;
color: inherit;
}