Title: Background for fixed widget
Last modified: January 4, 2019

---

# Background for fixed widget

 *  Resolved [wlltat](https://wordpress.org/support/users/wlltat/)
 * (@wlltat)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/background-for-fixed-widget/)
 * Dear Developer,
    Thank you for this very handy plugin.
 * I use a faint grey colour for my entire primary sidebar which helps it differentiate
   the whole website (website has plain white colour)
 * Now after the widget gets fixed and user scrolls down the long post, the background
   colour of primary sidebar scrolls up and there is no background colour on the
   fixed widget.
 * What is the CSS TO ADD BACKGROUND COLOUR TO FIXED WIDGET?

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Contributor [Max Bond](https://wordpress.org/support/users/max-bond/)
 * (@max-bond)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/background-for-fixed-widget/#post-11108157)
 * Hello!
 * I need to see your sidebar in action. Can you provide a link?
 *  Thread Starter [wlltat](https://wordpress.org/support/users/wlltat/)
 * (@wlltat)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/background-for-fixed-widget/#post-11108182)
 * Hi,
    Here is the website link. [https://www.writinglaw.com/all-rules-on-advocates-different-duties/](https://www.writinglaw.com/all-rules-on-advocates-different-duties/)
 * You can see that main primary sidebar on right has a light grey colour. After
   you scroll down the post, you can see that the fixed widget has no grey background
   colour.
 * It would be great if you tell me a way (css or some other way) to add colour 
   to background in fixed widget.
 * Thank You
 *  Plugin Contributor [Max Bond](https://wordpress.org/support/users/max-bond/)
 * (@max-bond)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/background-for-fixed-widget/#post-11108211)
 * Yes, I see it.
 * First you can assign background to .widget class:
 *     ```
       .widget {
         background: #f8f8f8;
       }
       ```
   
 * But sidebar has 15px of left and right padding. It would be better to change 
   sidebar paddings to 0, and add `0 15px` padding to widgets
 *  Thread Starter [wlltat](https://wordpress.org/support/users/wlltat/)
 * (@wlltat)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/background-for-fixed-widget/#post-11108306)
 * Using this CSS it changes the background of all widgets including those in website
   footer, sub footer and elsewhere. How do I use it to change only for fixed widget?
 * I already use-
    .sidebar { background: #f8f8f8;} for primary sidebar background.
 * (I am not able to find the exact widget class or widget id of this fixed widget.)
 * (Also, is there a CSS to change sidebar padding.)
 * I have very limited coding knowledge.
 * Thank You
 *  Plugin Contributor [Max Bond](https://wordpress.org/support/users/max-bond/)
 * (@max-bond)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/background-for-fixed-widget/#post-11108326)
 * You cannot specifically target only fixed widgets, but you can be more precise:
   `.
   sidebar-primary .widget` – that will target only sidebar widgets.
 * > I already use-
   >     ```
   >     .sidebar { background: #f8f8f8;}
   >     for primary sidebar background.
   >     ```
   > 
 * That is not enought, because sidebar has limited height!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Background for fixed widget’ is closed to new replies.

 * ![](https://ps.w.org/q2w3-fixed-widget/assets/icon-256x256.png?rev=2384479)
 * [Fixed Widget and Sticky Elements for WordPress](https://wordpress.org/plugins/q2w3-fixed-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/q2w3-fixed-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/q2w3-fixed-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/q2w3-fixed-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/q2w3-fixed-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/q2w3-fixed-widget/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Max Bond](https://wordpress.org/support/users/max-bond/)
 * Last activity: [7 years, 4 months ago](https://wordpress.org/support/topic/background-for-fixed-widget/#post-11108326)
 * Status: resolved