1. HOT Add more varieties for your Divi header (12 premade styles): https://header.diviultimate.com/
NEW Divi Block - Online drag & drop tool to easily mix & match 320+ premade Divi blocks (light / dark version), including custom header, fullscreen / slide in mobile menu, footer, etc. We also added NEW special module designs, such as Before & After Image Slider, Masonry Gallery, Promo Bar, Logo Carousel, etc.Try Free Version

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


    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.

    1. AD Free download for Divi Mobile Bar Plugin:Learn More
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    It should be this:

    .three-tabs .et_pb_tabs_controls


    .three-tabs .et_pb_tabs_controls li
  3. Sbuch

    Sbuch New Member

    Thanks a lot ! Great
    1. AD Add more varieties for your Divi header (12 premade styles):Learn More