Skip Navigation

[Resolved] Styling tabs within a tab cell

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to style tabs inserted in a Layout

Solution:
Tabs in a Layout inherit their basic styles from Bootstrap, and you can add additional styling as required.

This, for example, would set the tab widths to one-third and apply a background colour:

.nav-tabs > li {
    width: 33.3%;
    background-color: #fee;
}

Relevant Documentation:
https://toolset.com/documentation/user-guides/tabs-cell/

This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by IvanaB3904 6 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#726129

Hi
Being a newbie using Toolset, I need to ask some pretty simple questions, I suspect. Could you please point me to the guide for styling a tab cell? I want to be able to align text on tab title (left, right or middle) and tell each tab to occupy certain width of the page, then the colour of background and so on. I have searched the site and have found the reference to styling of a row, a cell, and so on, but nothing referring specifically to styling of tabs. (Probably because most people already know how to do it).
I would guess that it is something pretty simple - but can you point me in the right direction?
Thank you very much.
Best regards,
Ivana

#726947

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ivana

The tabs added to a Layout are built upon Bootstrap tabs.

If you want to style them you should add custom CSS with the rules you require.

This, for example, would set the tab widths to one-third and apply a background colour:

.nav-tabs > li {
    width: 33.3%;
    background-color: #fee;
}

I recommend you use your browser inspector to see the rules that are currently applied to the tabs so that you can see how to target them and possibly overwrite existing styles.

You can add the custom CSS at Toolset > Layouts CSS & JS.

(Note that such custom CSS is added to all pages, and so could affect tabs on other pages, which you may not want. You would need to target the page where the tabs are added more explicitly with your CSS rules, or you could simply add them inside style tags directly inside a Visual Editor cell, for example.)

https://toolset.com/documentation/user-guides/tabs-cell/

#729655

Hi Nigel.

Many thanks for your reply. It provides a direction, which is what i needed.

Best regards,

Ivana