How to apply different styles to e-tabitem

Hi,

Currently, I am using the following class to style the content of the tab items:

.e-tab .e-content .e-item.e-active {
background-color: gray;
padding: 2rem;
}

But this applies to all tab items in a tab.

How can I apply different styles to different tab items? 


3 Replies

RM Ruksar Moosa Sait Syncfusion Team September 27, 2022 11:55 AM UTC

Hi Cosmin,


We have checked on your query and suggest you set the id value to the Tab which will generate the id values to each tab items. Using the respective tab item id you can customize each tab like the below code. Kindly try the below sample and let us know if this meets your requirements.


[app.component.html]

<ejs-tab
id="DefaultTab"
heightAdjustMode='Auto'>


[app.component.css]

#e-item-DefaultTab_0,

#e-content-DefaultTab_0{

    background-colorrgb(168125125);

    padding2rem;

}


#e-item-DefaultTab_1,

#e-content-DefaultTab_1{

    background-colorrgb(1685555);

    padding2rem;

}


#e-item-DefaultTab_2,

#e-content-DefaultTab_2{

    background-colorrgb(230154154);

    padding2rem;

}


Sample: https://stackblitz.com/edit/angular-rtvjw6?file=app.component.css,app.component.html


Output:

A picture containing timeline

Description automatically generated

Regards,

Ruksar Moosa Sait



CB Cosmin Budac September 27, 2022 09:55 PM UTC

Thank you!



RV Ravikumar Venkatesan Syncfusion Team September 28, 2022 05:14 AM UTC

Hi Cosmin,


Thanks for the update.


Kindly try the shared solution and let us know if you need any further assistance on this.


Regards,

Ravikumar Venkatesan


Loader.
Up arrow icon