Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1078333

    Hello,
    I’ve noticed that while it’s possible to target a tab in the “tab element” on desktop ( min-width: 768px ), these tabs lose their specific css (.tab_counter_1, .tab_counter_2, etc.) on screens widths lower than 767px, when it changes to an accordion.
    So it becomes impossible to force different colors for each tab.
    Is there a solution for this?

    Thanks a lot!
    Max

    #1079926

    Hey maxgorelkine,

    When they loose their tab class, they do get a new class, which you can target for lower screen sizes.

    Best regards,
    Basilis

    #1079963

    Hi, Thanks for your answer… unfortunately they all get the same class .fullsize-tab so I can’t differentiate them and apply a different color to each tab…

    #1080977

    Hi maxgorelkine,

    Could you please give us a link to your website, we need more context to be able to help you.

    Could you please attach a mockup of what you’re trying to achieve?

    Best regards,
    Victoria

    #1085565

    Hello Victoria,
    Here is the exemple for desktop where each tab has a “tab_counter_1”, “tab_counter_2”, … class which allows me to target each tab separately and apply a different background color:

    And the same tab element on mobile where each tab loses it’s specific counter class and becomes just “fullsize-tab”, which makes it impossible to target each tab separately. I tried to use :nth-child() but it doesn’t seem to work.

    Thanks a lot for your help!

    • This reply was modified 5 years, 8 months ago by maxgorelkine.
    #1085604

    Hi,

    Please provide an actual link to the site so we can inspect the page ourselves and try to provide accurate code.

    Best regards,
    Jordan Shannon

    #1085715

    Hi Jordan,
    Here is the link :

    Thanks in advance!
    Max

    #1085951

    Hi maxgorelkine,

    You can target them with the css like this:

    
    @media only screen and (max-width: 767px) {
      #top .tabcontainer .tab.fullsize-tab[data-fake-id="#tab-id-1"] {
          background: rgba(208, 83, 83, 0.7);
      }
        #top .tabcontainer .tab.fullsize-tab[data-fake-id="#tab-id-2"] {
          background: rgba(216, 206, 77, 0.7);
      }
    }
    

    Best regards,
    Victoria

    #1086001

    Hi Victoria, you are amazing, it works like a charm!
    Thank you so much for your amazing support as always!
    Long live Kriesi! (and Enfold ! ;))

    • This reply was modified 5 years, 8 months ago by maxgorelkine.
    #1086296

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Target single tab via css in "tabs element" on mobile’ is closed to new replies.