简体   繁体   English

无法删除边框底部

[英]Can't remove border-bottom

I am trying to custom style the React mui tabs in order to accomplish something like this:我正在尝试自定义样式React mui 选项卡以完成以下操作:

在此处输入图像描述

I have tried to set the box-shadow to the selected tab and remove the border-bottom.我试图将框阴影设置为选定的选项卡并删除边框底部。 Setting box-shadow worked, but removing border-bottom didn't.设置 box-shadow 有效,但删除 border-bottom 没有。 This is the styles object:这是 styles object:

const styles = theme => ({
  root: {
    flexGrow: 1,
    backgroundColor: theme.palette.background.paper
  },
  selected: {
    boxShadow: theme.shadows[1]
  },
  tab: {
    border: "none"
  }
});

And this is how my tab looks like:这就是我的标签的样子:

   <Tab
     label="Item One"
     classes={{ selected: classes.selected, root: classes.tab }}
   />

You can see the whole example here .您可以在此处查看整个示例。

How am I suppose to remove that border on selected tab?我想如何删除选定选项卡上的边框? On expecting the element in the console I can't even see where the border is coming from.在期待控制台中的元素时,我什至看不到边框来自哪里。

I've just found indicatorColor Props我刚刚找到了indicatorColor Props

<Tabs indicatorColor={""} value={value} onChange={this.handleChange}> </Tabs>

Ref: https://material-ui.com/api/tabs/参考: https://material-ui.com/api/tabs/

You can simply set the element that is being used for that to display: none;您可以简单地设置用于display: none; :

<style>
  .MuiTabs-indicator {
    display: none;
  }
</style>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM