Archived topic
Change background of particular widget?
7 replies · Started by Petar on April 17, 2022
Hello, would it be possible to change the background color of a widget(s) by my choice? I need the standard white color removed. If it helps, these are all widgets in the left sidebar.
thankss
Hi Petar,
If you have GenerateBlocks, you may place your widgets inside a Container Block in Appearance > Widgets > Left Sidebar, and assign a color to the Container as such: https://share.getcloudapp.com/L1uRvN4z
You may also use WordPress core Block Columns as such: https://share.getcloudapp.com/wbuzL9rO
Otherwise, you can do it through custom CSS.
Hope this clarifies. :)
huh...considering I am using classic widgets plugin, maybe the best way would be with custom CSS>?
I see. May you kindly link us to the site in question?
Hope to hear from you soon. :)
Link added in private information
Hi there,
you can use some CSS like so:
.inside-left-sidebar .widget:nth-child(4) {
background-color: transparent;
}
And if for example you wanted to remove the padding and force an image to fill the width of the sidebar you could do this:
.inside-left-sidebar .widget:nth-child(4) {
background-color: transparent;
padding: 0;
}
.inside-left-sidebar .widget:nth-child(4) img {
width: 100%;
}
that was fast. thanks
You're welcome.
Sorry forgot to say the 4 is the widget count, so that would apply to the 4th widget in the sidebar. Change the number to suit your needs.