How to Change Widget Background
-
hi, im trying to change sidebar widget background but still didnt work. pls help!!
-
I guess, this should work also for you:
div#secondary { background:#THE_COLOUR_YOU_LIKE; }and
and
hi, thanks for your reply. i dont have any coding background. where should i put in this code pls? could u teach me step by step pls? thanks π
Option 1st:
Themes/Editor —> Changing the CCS-File
Option 2 (better):
Using “Simple Custom CSS”-Plugin —> Inserting there the code
Option 3:
Creating a so-called child-theme and insertig there the code.
Hi, thanks! it works!! Im using the 2nd method. what if i wanted to add border to eacch widget and each widget with own background color pls?
please include some padding as well cause it looks kinda weird with color right now. hehe. thanks π
what if i wanted to add border to eacch widget
E.g.:
div#secondary aside:nth-child(1n+1){ border: 1px solid #THE_COLOUR_YOU_LIKE; }please include some padding
Try this:
padding: 14px 20px 17px 0;The padding-sequence is: top, right, bottom, left
each widget with own background color pls
Follow the instructions there:
http://css-tricks.com/how-nth-child-works/
via
https://wordpress.org/support/topic/different-background-colours-for-different-sidebar-widgets?replies=11#post-6029793PS. @ padding
If it should apply to the entire sidebar, you have to insert it there:
div#secondary { background:#THE_COLOUR_YOU_LIKE; }If it should apply to the indivudal widgets, you have to insert it there:
div#secondary aside:nth-child(1n+1){ border: 1px solid #THE_COLOUR_YOU_LIKE; }PPS.:
(1n+1)means the property applies to all widgets.Thank you very much. it works!!! π
You have to say ‘Thank your’ to emilyTK – I have learnt it from her.
Sure. What if i wanted to add a line to seperate main content and sidebar? sidebar with color as well. what should i do pls?
The topic ‘How to Change Widget Background’ is closed to new replies.