Site logo

Archived topic

How To Remove Padding Of Specific Widget Title

3 replies · Started by Joezer on June 2, 2020

Viewing posts 1–4 of 4

Hello, at the "Popular posts" sidebar widget, I set it so that the a background image is present at the widget title. What I want to do is remove the padding only for the title area, so that the image will occupy the whole left and right and top part. Kinda like if I set the CSS below:

.widget-area #text-6.widget {
padding: 0;
}

The only problem with the code above is that it also removes the inner padding of the text content below the title of of the widget. I want to retain their 20px padding. I only want the title + image background to have 0 padding. Is this possible? I am trying different combinations of the code but I can't seem to do it.

Hi there,

Try adding the CSS below to your existing CSS applying the background image.

margin-left: -20px;
margin-right: -20px;

Then just remove the top padding:

.widget-area #text-6.widget {
    padding-top: 0;
}

It works perfectly. Thanks, Leo!

No problem :)

This archived topic is closed to new replies.