When utilizing the react bootstrap tabs
component, I encountered an issue with implementing a custom CSS style for the nav-link
element within it using a customized parent class indicator.
<Tabs
defaultActiveKey="signup_renter"
id="uncontrolled-tab-example"
className="mb-3 approval-details-tab"
>
<Tab eventKey="signup_renter" title="About Car">
<div className="signup-renter">
this is signup renter tab
</div>
</Tab>
<Tab eventKey="signup_host" title="Details">
<div className="signup-host">
this is signup host tab
</div>
</Tab>
</Tabs>
Below is the CSS code for the parent indicator:
.approval-details-tab > .nav-tabs .nav-link.active::before {
content: "";
background: #524eb7;
width: 30px;
height: 3px;
position: absolute;
top: 63% !important;
}
The problem arises when I use the .approval-details-tab
as the parent class of nav-tabs
, causing the custom styling to not work. However, the styling applies without using a parent class. Unfortunately, I require a parent class for distinctive design purposes.