Forums / Templates, Stylesheets, Page Layout / Category list box contents - change link bg colour

Category list box contents - change link bg colour

Views: 779

Results 1 to 7 of 7
6 Feb 2014, 1:00 AM
#1
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Category list box contents - change link bg colour

Hello I want to change the background colour of the link text in the category list box contents.To look like the image below:
Attachment 13750

I have tried to style the links in css but it affects all ez pages links.
Example of what I did:
.categoryListBoxContents a:link, {background-color:#ffffff;
}

So then, do I alter modules/category_row.php file?
if so would it be this( line 38) that I edit and if so how do I write it in?

$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"'

Any help appreciated.

6 Feb 2014, 1:06 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Category list box contents - change link bg colour

When asking styling questions, a link to the page is much more useful than a screenshot.

6 Feb 2014, 1:16 AM
#3
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Category list box contents - change link bg colour

I am working on a local machine using xampp didn't know I could post a link to it.
Here is the link I use in my browser http://www.example.com/thai_restaurant/

6 Feb 2014, 2:05 AM
#4
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Category list box contents - change link bg colour

Even if someone could tell me how to add a class to the links for the category list box contents. I think that would work.

6 Feb 2014, 2:15 AM
#5
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Category list box contents - change link bg colour

Ok figured it out. For anyone else trying this, it was possible to style this using css.
Looks like my above syntax was wrong. What does work for me is:
.categoryListBoxContents a:link{background-color:#FFFFFF;
}

Not too different from the earlier mentioned code just removed the comma.
Hope this helps someone :smile:

6 Feb 2014, 3:31 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Category list box contents - change link bg colour

Sorry, we can't see a link on your local machine. That will make it trickier for us to advise. You say > Example of what I did:

.categoryListBoxContents a:link, {background-color:#ffffff;
} Is that exactly what you did? There is a comma after the one selector that will invalidate the rule. Make it

.categoryListBoxContents a:link {background-color:#ffffff;
}
``` and see what happens. This rule can only affect links inside the categoryListBoxContents element.


Glad you got it fixed:)
6 Feb 2014, 10:54 PM
#7
annie_zaz avatar

annie_zaz

Zen Follower

Join Date:
Mar 2013
Location:
Sydney, Australia
Posts:
140
Plugin Contributions:
0

Re: Category list box contents - change link bg colour

Ah ok, Thanks for the input. Am ever grateful as ever gih42 :smile: