Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Left Aligning Tabs

11 years 3 months ago - 11 years 3 months ago #230321 by mccormackdave
[SOLVED] Left Aligning Tabs was created by mccormackdave
Hi im Wondering if it is possible to left align the tabs from the tabbed panes to the left of the main tab box. instead of a horizontal line above the box

Thanks

Dave
Last edit: 11 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #230363 by krileon
Replied by krileon on topic Left Align Tabs
Only with CSS. Example as follows.

Code:
.cbProfile #cb_tabmain > .tab-row { float: left; width: 30%; padding: 0; margin: 0; vertical-align: top; } .cbProfile #cb_tabmain > .tab-page { float: left; clear: none; width: 65%; margin: 0; vertical-align: top; } .cbProfile #cb_tabmain > .tab-page:last-child:after { display: block; content: ""; clear: both; }

Below is what the above will output.



Adjust as needed for further design changes. For example you could make all the tabs not floated so they display in a list using the below.

Code:
.cbProfile #cb_tabmain > .tab-row > .tab { display: block; float: none; width: 80%; padding: 0; margin: 0 0 5px 0; }

The above in addition to the first block of CSS would give the below.



Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Attachments:
The following user(s) said Thank You: mccormackdave

Please Log in or Create an account to join the conversation.

11 years 3 months ago #230398 by mccormackdave
Replied by mccormackdave on topic [Solved] Left Aligning Tabs
Hi Krileon

Thank you so much again you always there to help thats why i love community builder :-)

I have another Question

I am trying to change the color of tabs using CSS to have certain colors for different tabs

im trying out combinations but i cant seem to get it to work

can you have a look below and see if what im doing is completely wrong approach

.cbProfile #cb_tabmain > .tab-row > .tab-id82 {
background-color: #FFCC00;
background-image: linear-gradient(#FFCC00, #FFCC00, orange);
border: 1px solid #DDDDDD;
box-shadow: 3px 3px 3px #BBBBBB;
display: block;
float: none;
font-family: verdana;
font-size: 12px;
margin-bottom: 5px;
padding: 3px 10px;
text-align: center;
width: 90%;
}





Am i trying the impossible here?

is there a solution?

I wish to have a different color tabs and different color pages with each tab

Thank you

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48466
  • Thanks: 8280
  • Karma: 1443
11 years 3 months ago #230405 by krileon
Replied by krileon on topic [Solved] Left Aligning Tabs

can you have a look below and see if what im doing is completely wrong approach

The selector you're using doesn't exist. Please use Chrome or Firebug for Firefox then right click and inspect the tabs to see their structure, which will expose their classes and ids to be used as CSS selectors.

The method you're trying to use won't work however as the tabs don't have unique classes or IDs for you to easily target and style them, but you can do this with CSS3. Example as follows.

Code:
.cbProfile #cb_tabmain > .tab-row > .tab:nth-child(1) { background-color: red; } .cbProfile #cb_tabmain > .tab-row > .tab:nth-child(2) { background-color: blue; } .cbProfile #cb_tabmain > .tab-row > .tab:nth-child(3) { background-color: green; } .cbProfile #cb_tabmain > .tab-row > .tab:nth-child(4) { background-color: orange; }

The above will style the background of the first 4 tabs. You can add more using nth-child and simply set what tab you want it to style in the order they display. The tab content it self does have a unique ID for each tab so you can target them specifically; example as follows.

Code:
.cbProfile #cb_tabmain > #cbtab12 { background-color: red; } .cbProfile #cb_tabmain > #cbtab13 { background-color: blue; } .cbProfile #cb_tabmain > #cbtab15 { background-color: green; } .cbProfile #cb_tabmain > #cbtab23 { background-color: orange; }

The more easier approach is to use nth-child for this too. Example as follows. Note the below starts with 2 instead of 1 due to the tabs themselves being a child element of the tab container so tab content begins at 2.

Code:
.cbProfile #cb_tabmain > .tab-page:nth-child(2) { background-color: red; } .cbProfile #cb_tabmain > .tab-page:nth-child(3) { background-color: blue; } .cbProfile #cb_tabmain > .tab-page:nth-child(4) { background-color: green; } .cbProfile #cb_tabmain > .tab-page:nth-child(5) { background-color: orange; }

You now should be able to style your tabs and their content individually.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: mccormackdave

Please Log in or Create an account to join the conversation.

  • AchLive
  • AchLive
  • OFFLINE
  • Posts: 253
  • Thanks: 14
  • Karma: 3
11 years 3 months ago #230412 by AchLive
Replied by AchLive on topic [Solved] Left Aligning Tabs
This is a nice option. But you can also do with the template bootstrap? Which file should you modify?

Please Log in or Create an account to join the conversation.

11 years 3 months ago #230414 by mccormackdave
Replied by mccormackdave on topic [Solved] Left Aligning Tabs
All you have to do for bootstrap is

change the .cbProfile to .cb_template_bootstrap



example
.cbProfile #cb_tabmain > .tab-row > .tab

to

.cb_template_bootstrap #cb_tabmain > .tab-row > .tab

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum