gpt4 book ai didi

css - React Bootstrap Tabs - 在 div 的整个宽度上均匀分布

转载 作者:行者123 更新时间:2023-11-28 14:14:37 25 4
gpt4 key购买 nike

我有一个引导标签栏如下:

<div>
<Tabs defaultActiveKey="profile" id="uncontrolled-tab-example" style={style1}>
<Tab eventKey="policies" title="Policies" style={style2}>
slakf lsjdflkadsjf lkadkfdksjflk lakdffj lsdjlk lkdfk kldnfkjk lasdfj lksdfjkajfl lkadjflkadlkf ksdjflkajsf
</Tab>
<Tab eventKey="reporting" title="Reporting" style={style2}>
d
</Tab>
<Tab eventKey="dashboard" title="Dashboard" style={style2}>
f
</Tab>
<Tab eventKey="editProfile" title="Manage Profile" style={style2}>
f
</Tab>
<Tab eventKey="community" title="Community" style={style2}>
f
</Tab>
</Tabs>
</div>

我想弄清楚如何在 div 的整个宽度上均匀分布制表符。目前,它们聚集在左侧。我什至不能强制他们在右边。

减少 Tabs 元素的宽度也会减少选项卡内容的宽度——我想避免这种情况。

目前,我尝试过:

const style1 = {
fontSize: '90%',
marginLeft: 'auto',
textAlign: 'center',
marginRight: 'auto',
float: 'justify',
width: '80%'
}

const style2 = {
textAlign: 'center',

}

我读过其他用户放弃尝试的帖子,他们建议使用表格而不是选项卡。是否有一个选项允许使用标签宽度均匀对齐的标签?

最佳答案

只需在选项卡中包含单词 fill 和 justify(参见下面的示例):

<Tabs fill justify defaultActiveKey="home" id="uncontrolled-tab-example" className={styles.tabLinkContainer}>

关于css - React Bootstrap Tabs - 在 div 的整个宽度上均匀分布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56051582/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com