Overriding Inline css of wordpress template

I want to override the style padding-top:100px to padding-top:0px. How can i override the inline style inside wordpress template?

<!-- Sidebar With Content Section-->
    <div class="with-sidebar-wrapper">
  <section id="content-section-1" >
  <div class="gdlr-full-size-wrapper gdlr-show-all"  style="padding-top: 100px; padding-bottom: 0px;  background-color: #ffffff; "  ><div class="gdlr-master-slider-item gdlr-slider-item gdlr-item"  style="margin-bottom: 0px;"  >
    <!-- MasterSlider -->

I already tried the below code in style.css but its not working!

.gdlr-full-size-wrapper .gdlr-show-all{
padding-top:0px !important;
}

Related posts

3 comments

  1. To select this perticular <div> you to write your CSS like:

     .gdlr-full-size-wrapper.gdlr-show-all {
    
     } /*without space between*/
    

    you’re using

     .gdlr-full-size-wrapper .gdlr-show-all {
    
     }
    

    viz selecting

    <div class="gdlr-full-size-wrapper">
       <div class="gdlr-show-all"></div>
    </div>
    

    Also if you’re willing to override inline CSS only then you can use [style] selector also.

    As:

    <div class="someClass" style="font-size:10px; "></div>
    

    So we can write CSS like:

    .someClass[style] { font-size:14px !important}
    

    what’s trick here is this CSS only works when someClass has inline CSS for font.

  2. Use following code it will work for both cases if you have one or both classes on div tag.

    .gdlr-full-size-wrapper.gdlr-show-all, .gdlr-full-size-wrapper .gdlr-show-all
    {
     padding-top:0px !important;
    }
    
  3. Justinas explains it well and that should work perfectly, I have applied the same to custom CSS of a WordPress theme and has worked for me. The CSS I had trouble changing were inline a div.

Comments are closed.