WpBakery (Visual Composer) - Responsive best practices











up vote
1
down vote

favorite












I'm using wpbakery wordpress plugin. I added in design options padding and generated css code looks like:



.vc_custom_1541499756394 {
padding-top: 30px !important;
padding-right: 250px !important;
padding-left: 250px !important;
}


I need to remove padding on smaller screen sizes.
My question is, what is best practice to do that?
Simple media query like this or there is better way?



@media only screen and (max-width: 720px) {
.vc_custom_1541499756394 {
padding-top: 0px !important;
padding-right: 0px !important;
padding-left: 0px !important;
}
}









share|improve this question


























    up vote
    1
    down vote

    favorite












    I'm using wpbakery wordpress plugin. I added in design options padding and generated css code looks like:



    .vc_custom_1541499756394 {
    padding-top: 30px !important;
    padding-right: 250px !important;
    padding-left: 250px !important;
    }


    I need to remove padding on smaller screen sizes.
    My question is, what is best practice to do that?
    Simple media query like this or there is better way?



    @media only screen and (max-width: 720px) {
    .vc_custom_1541499756394 {
    padding-top: 0px !important;
    padding-right: 0px !important;
    padding-left: 0px !important;
    }
    }









    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm using wpbakery wordpress plugin. I added in design options padding and generated css code looks like:



      .vc_custom_1541499756394 {
      padding-top: 30px !important;
      padding-right: 250px !important;
      padding-left: 250px !important;
      }


      I need to remove padding on smaller screen sizes.
      My question is, what is best practice to do that?
      Simple media query like this or there is better way?



      @media only screen and (max-width: 720px) {
      .vc_custom_1541499756394 {
      padding-top: 0px !important;
      padding-right: 0px !important;
      padding-left: 0px !important;
      }
      }









      share|improve this question













      I'm using wpbakery wordpress plugin. I added in design options padding and generated css code looks like:



      .vc_custom_1541499756394 {
      padding-top: 30px !important;
      padding-right: 250px !important;
      padding-left: 250px !important;
      }


      I need to remove padding on smaller screen sizes.
      My question is, what is best practice to do that?
      Simple media query like this or there is better way?



      @media only screen and (max-width: 720px) {
      .vc_custom_1541499756394 {
      padding-top: 0px !important;
      padding-right: 0px !important;
      padding-left: 0px !important;
      }
      }






      css wordpress responsive visual-composer






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 10:23









      user3590094

      807




      807
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          A more flexible approach would be to remove all of the styles you've added to the VC meta box and assign a class to it, pushing the required styles that way. Doing so will enable you to be specific for viewports and enable you to reuse the style across your site.



          Set your Design Options like this:



          enter image description here



          And assign a style here:



          enter image description here



          Then add the required styles to the class.



          Hope that helps :)






          share|improve this answer





















          • Thanks, i see ... using Design options is a bad practice..
            – user3590094
            Nov 7 at 12:26










          • I'm not sure it's 'bad practice' but you can make life easier for yourself by using classes.
            – Ash Loudon
            Nov 7 at 12:27










          • Yes, but i didn't find way to remove padding on mobile screens when is added on Design options...vc-custom class can't be overided... or i'm wrong?
            – user3590094
            Nov 7 at 12:51










          • Remove all the padding in the design options and include it as a declaration on the class you specify for that element.
            – Ash Loudon
            Nov 7 at 13:23











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187536%2fwpbakery-visual-composer-responsive-best-practices%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          A more flexible approach would be to remove all of the styles you've added to the VC meta box and assign a class to it, pushing the required styles that way. Doing so will enable you to be specific for viewports and enable you to reuse the style across your site.



          Set your Design Options like this:



          enter image description here



          And assign a style here:



          enter image description here



          Then add the required styles to the class.



          Hope that helps :)






          share|improve this answer





















          • Thanks, i see ... using Design options is a bad practice..
            – user3590094
            Nov 7 at 12:26










          • I'm not sure it's 'bad practice' but you can make life easier for yourself by using classes.
            – Ash Loudon
            Nov 7 at 12:27










          • Yes, but i didn't find way to remove padding on mobile screens when is added on Design options...vc-custom class can't be overided... or i'm wrong?
            – user3590094
            Nov 7 at 12:51










          • Remove all the padding in the design options and include it as a declaration on the class you specify for that element.
            – Ash Loudon
            Nov 7 at 13:23















          up vote
          1
          down vote













          A more flexible approach would be to remove all of the styles you've added to the VC meta box and assign a class to it, pushing the required styles that way. Doing so will enable you to be specific for viewports and enable you to reuse the style across your site.



          Set your Design Options like this:



          enter image description here



          And assign a style here:



          enter image description here



          Then add the required styles to the class.



          Hope that helps :)






          share|improve this answer





















          • Thanks, i see ... using Design options is a bad practice..
            – user3590094
            Nov 7 at 12:26










          • I'm not sure it's 'bad practice' but you can make life easier for yourself by using classes.
            – Ash Loudon
            Nov 7 at 12:27










          • Yes, but i didn't find way to remove padding on mobile screens when is added on Design options...vc-custom class can't be overided... or i'm wrong?
            – user3590094
            Nov 7 at 12:51










          • Remove all the padding in the design options and include it as a declaration on the class you specify for that element.
            – Ash Loudon
            Nov 7 at 13:23













          up vote
          1
          down vote










          up vote
          1
          down vote









          A more flexible approach would be to remove all of the styles you've added to the VC meta box and assign a class to it, pushing the required styles that way. Doing so will enable you to be specific for viewports and enable you to reuse the style across your site.



          Set your Design Options like this:



          enter image description here



          And assign a style here:



          enter image description here



          Then add the required styles to the class.



          Hope that helps :)






          share|improve this answer












          A more flexible approach would be to remove all of the styles you've added to the VC meta box and assign a class to it, pushing the required styles that way. Doing so will enable you to be specific for viewports and enable you to reuse the style across your site.



          Set your Design Options like this:



          enter image description here



          And assign a style here:



          enter image description here



          Then add the required styles to the class.



          Hope that helps :)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 7 at 12:21









          Ash Loudon

          348




          348












          • Thanks, i see ... using Design options is a bad practice..
            – user3590094
            Nov 7 at 12:26










          • I'm not sure it's 'bad practice' but you can make life easier for yourself by using classes.
            – Ash Loudon
            Nov 7 at 12:27










          • Yes, but i didn't find way to remove padding on mobile screens when is added on Design options...vc-custom class can't be overided... or i'm wrong?
            – user3590094
            Nov 7 at 12:51










          • Remove all the padding in the design options and include it as a declaration on the class you specify for that element.
            – Ash Loudon
            Nov 7 at 13:23


















          • Thanks, i see ... using Design options is a bad practice..
            – user3590094
            Nov 7 at 12:26










          • I'm not sure it's 'bad practice' but you can make life easier for yourself by using classes.
            – Ash Loudon
            Nov 7 at 12:27










          • Yes, but i didn't find way to remove padding on mobile screens when is added on Design options...vc-custom class can't be overided... or i'm wrong?
            – user3590094
            Nov 7 at 12:51










          • Remove all the padding in the design options and include it as a declaration on the class you specify for that element.
            – Ash Loudon
            Nov 7 at 13:23
















          Thanks, i see ... using Design options is a bad practice..
          – user3590094
          Nov 7 at 12:26




          Thanks, i see ... using Design options is a bad practice..
          – user3590094
          Nov 7 at 12:26












          I'm not sure it's 'bad practice' but you can make life easier for yourself by using classes.
          – Ash Loudon
          Nov 7 at 12:27




          I'm not sure it's 'bad practice' but you can make life easier for yourself by using classes.
          – Ash Loudon
          Nov 7 at 12:27












          Yes, but i didn't find way to remove padding on mobile screens when is added on Design options...vc-custom class can't be overided... or i'm wrong?
          – user3590094
          Nov 7 at 12:51




          Yes, but i didn't find way to remove padding on mobile screens when is added on Design options...vc-custom class can't be overided... or i'm wrong?
          – user3590094
          Nov 7 at 12:51












          Remove all the padding in the design options and include it as a declaration on the class you specify for that element.
          – Ash Loudon
          Nov 7 at 13:23




          Remove all the padding in the design options and include it as a declaration on the class you specify for that element.
          – Ash Loudon
          Nov 7 at 13:23


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187536%2fwpbakery-visual-composer-responsive-best-practices%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Xamarin.form Move up view when keyboard appear

          Post-Redirect-Get with Spring WebFlux and Thymeleaf

          Anylogic : not able to use stopDelay()