Hi, I have read the thread on here about how to add background color to text widgets. I've done that, and it worked, but I am not happy with the look.
1.
Here's a screenshot of the result when I used the following code in custom css:

Best Answer Danny , 22 March 2013 - 10:15 AM
Hi,
If you use Firebug or your browsers web dev tools and inspect your text widget, you will see that all text widgets are given the following class.
.widget_text
Which you can use to style all text widgets.
Not sure what you're referring to, by image widgets.
Go to the full post
Posted 21 March 2013 - 11:42 PM
Hi, I have read the thread on here about how to add background color to text widgets. I've done that, and it worked, but I am not happy with the look.
1.
Here's a screenshot of the result when I used the following code in custom css:

Posted 22 March 2013 - 01:23 AM
OK, so I found something on another thread (http://www.pagelines...und#entry130423)
and adapted it like this for my color choice:
But I still don't understand...
What is 'searchlight' and how would I have know to use that? It's not anywhere in the w3schools.com stuff I read on selectors or classes.
When making css classes like this, do we just make up a name? If so, how is my site figuring out that 'searchlight' is my textwidget and not other widgets? Otherwise, when I use firebug, as in my post above, I tried to put what I found as the selector, but the code wasn't generating anything for the textwidgets.
Just to learn, I changed the code to this:
How do I write the selector portion so that ONLY my Text Widgets in the Sidebar are affected and not my Image Widget?
On this page of my site (www.laccdev.lightoflearning.org/now/), I have an Image Widget on top, then a Text Widget. I'd like to control what happens to each kind of widget...
Anyway, now I also have rounded corners, and I'm happy about that bonus in this 'fix'.
Thanks for any help coming my way. ![]()
Posted 22 March 2013 - 01:36 AM
Ok, I'm learning and learning...sorry for the many posts.
After I reloaded my Custom Css page, the code cleaned itself up to the following (which still puts a background behind the widget+padding for all sidebar widgets, as it did up above when it had the 'searchlight' stuff in it):
Posted 22 March 2013 - 03:09 AM
Hi Anet
If you're looking to target one particular text-widget with css, you can use the 'text-li' id to apply the css to.
Like here - http://screencast.com/t/v98CninpS
You'd place that in front of your selector.
#text-9
.widget
.widget-pad
{
background: #d0cece;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
padding: 5px;
margin: 5px;
}
If you just wanted to affect widgets in the sidebar, add the sidebar class as a prefix to your css.
.section-sb_primary
.widget
.widget-pad
{
background: #d0cece;
border-radius: 5px 5px 5px 5px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
padding: 5px;
margin: 5px;
}
Think of it was each time you put a higher prefix in from of your code, you're making that code more specific, closing in on certain areas etc.
Hope that helps.
Posted 22 March 2013 - 09:38 AM
Hi, James,
What you wrote is helpful. But I want to target all textwidgets in the sidebars, and at the same time not target the image widgets in the side bars...any way to do that?
If not possible, I can live with the background on both textwidgets and imagewidgets, but wanted to know how to target one type of widget.
Thanks very much!
Posted 22 March 2013 - 10:15 AM Best Answer
Hi,
If you use Firebug or your browsers web dev tools and inspect your text widget, you will see that all text widgets are given the following class.
.widget_text
Which you can use to style all text widgets.
Not sure what you're referring to, by image widgets.
Posted 22 March 2013 - 01:06 PM
Hi, James,
Ok, I was using textwidget, cuz that's what was highlighted when I clicked to inspect the textbox...here's a screenie.

I guess I should have known to use the 'higher' class?
I'll go play with that in the code later today; working on other things for a few hours.
Thanks so much for all your help!!
oh, Image widgets = another kind of widget that I also use in the sidebars.
Edited by anet, 22 March 2013 - 01:07 PM.