1. PROMO Upgrade to Pro Membership @ $99 / Lifetime & access all our 16+ premium Divi extensions: Divi Block, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved Apply css margins only to desktop display of "Tabs control"

Discussion in 'Free Divi Community Forum' started by Sbuch, Jul 22, 2021.

  1. Sbuch

    Sbuch New Member

    Hello,

    I've been trying to create the right CSS code for a specific feature for a few days now...

    In a tabs module, i'm applying the following code, in the "Tabs settings" / "Advanced" / "Custom CSS" / "Tabs control" :

    margin-left: 200px;
    margin-right: 200px;

    It works fine: i just want the line of the tabs to be narrower horizontally, but the content of the tabs within to have no margin restriction (so it's wider than the tabs line). Example: https://samuelbuchoul.com/publications/

    However, that doesn't give a good result in phone and tablet display... So i would like to apply that css only to the desktop display. I tried variations of the following code in the "Custom CSS" main box, in the Divi settings... but it's not working.

    @Media (min-width: 980px) {
    .three-tabs .et_pb_tabs_controls li {
    margin-left: 200px;
    margin-right: 200px;
    }}

    My tab already has the css class ".three-tabs", with some other custom CSS applied to it.

    But even without the "@Media" specification, the code doesn't work... I don't know if i have to use the designation ".et_pb_tabs_0", or perhaps remove the "li" at the end of the line...

    Would you see where the mistake is, in my code?

    Thanks a lot for your help.

    SB
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade horizontal timeline design for your Divi site without using any plugins:View Demo
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    It should be this:

    .three-tabs .et_pb_tabs_controls

    not:

    .three-tabs .et_pb_tabs_controls li
     
  3. Sbuch

    Sbuch New Member

    Thanks a lot ! Great
     
    1. PRO MEMBER PERKS Divi Block Pro - Premade rolling text design for your Divi site without using any plugins:View Demo