我有以下几点:
如何去掉蓝色下划线? 代码如下:
<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
当前回答
a {
text-decoration: none !important;
color: black !important;
font-size: 20px;
}
在App.css中使用
其他回答
style={{ backgroundImage: "none" }}
只有这对我有用
还有另一种方法可以正确地删除链接的样式。你必须给它的textDecoration='inherit'和color='inherit'的风格,你可以添加这些作为样式的链接标签,如:
<Link style={{ color: 'inherit', textDecoration: 'inherit'}}>
或者为了使它更通用,只需创建一个CSS类:
.text-link {
color: inherit;
text-decoration: inherit;
}
然后只需<Link className='text-link'>
<Link
to='/maxpain'
replace
style={{
textDecoration: 'none'
}}
>
<LinkText>Click here!</LinkText>
</Link>
就这么简单!
标准的a-link和react-link是一样的。
如果你要样式化a-link,它会自动样式化react-link。
一个{ 你想要什么造型 }
<Link to="/page">
<Box sx={{ display: 'inline-block' }}>
<PLink variant="primary">Page</PLink>
</Box>
</Link>
在某些情况下,当在Gatsby <Link>组件中使用另一个组件时,在内部组件周围添加带有display: 'inline-block'的div,可以防止下划线(在示例中为'Page')。