Zen Cart Logo
Forums / Basic Configuration / Sidebox contents hover background colour

Sidebox contents hover background colour

Locked

Views: 2,340

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
8 Jul 2007, 10:21 AM
#1
chabbu avatar

chabbu

New Zenner

Join Date:
Jul 2007
Posts:
75
Plugin Contributions:
0

Sidebox contents hover background colour

Hi,

I hope some experienced zen-carters can help me. I'd like to have a background colour appear in the catergory listing when it is hovered over in the sidebox only - just like this site: http://shop.technopro.co.za/

I'm using the default installation stylesheet and customising that to my needs but i can't figure out what style controls that.

Please help.

8 Jul 2007, 1:50 PM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: Sidebox contents hover background colour

There is a "pseudo-style" called :hover which causes the behavior you want.

You can add this to the end of any link in your stylesheet, specify the CSS effects desired, and they will be applied on hover. (This is supposed to work on anything, but IE only supports it on links, so there's not much point trying it on anything else.)

You can see an example at the top of a stock stylesheet:```
a:link, #navEZPagesTOC ul li a {
color: #3300FF;
text-decoration: none;
}

a:visited {
color: #3300FF;
text-decoration: none;
}

a:hover, #navEZPagesTOC ul li a:hover, #navMain ul li a:hover, #navSupp ul li a:hover, #navCatTabs ul li a:hover {
color: #FF0000;
}


a.category-top is a good place to start for styling category links.
Use

a.category-top:hover {

}

for hover effects.
8 Jul 2007, 2:45 PM
#3
chabbu avatar

chabbu

New Zenner

Join Date:
Jul 2007
Posts:
75
Plugin Contributions:
0

Re: Sidebox contents hover background colour

Hi,

Thanks, but that does not span the whole width of the catergory sidebox, which is what i want it to do.

it only gives a background colour the width of the text to which it is applied.

8 Jul 2007, 2:58 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: Sidebox contents hover background colour

You need to use

display: block;

to get the whole width effect. This by itself will cause an extra space to appear between all your category names. To remove the space, you need to delete a <br /> from the code in tpl_categories.php, which in turn can cause other side effects. (You can eliminate this gap with a margin-bottom: -1.2em; added, but IE6 has a problem with this and displays a semi-random body background stripe below the element. So, it is necessary to use a more brute-force method...)

The Categories Dressing mod takes care of these tasks, and gives directions for styling as you desire.

8 Jul 2007, 3:50 PM
#5
chabbu avatar

chabbu

New Zenner

Join Date:
Jul 2007
Posts:
75
Plugin Contributions:
0

Re: Sidebox contents hover background colour

Thanks for that, it works but creates a break as you say.

9 Oct 2007, 7:45 PM
#6
glv avatar

glv

New Zenner

Join Date:
Oct 2007
Posts:
29
Plugin Contributions:
0

Re: Sidebox contents hover background colour

gjh42:

There is a "pseudo-style" called :hover which causes the behavior you want.

You can add this to the end of any link in your stylesheet, specify the CSS effects desired, and they will be applied on hover. (This is supposed to work on anything, but IE only supports it on links, so there's not much point trying it on anything else.)

You can see an example at the top of a stock stylesheet:```
a:link, #navEZPagesTOC ul li a {
color: #3300FF;
text-decoration: none;
}

a:visited {
color: #3300FF;
text-decoration: none;
}

a:hover, #navEZPagesTOC ul li a:hover, #navMain ul li a:hover, #navSupp ul li a:hover, #navCatTabs ul li a:hover {
color: #FF0000;
}

> 
> a.category-top is a good place to start for styling category links.
> Use
> 
> a.category-top:hover {
> 
> }
> 
> for hover effects.

THANK YOU, I was missing the "-top" *sigh* and I went through an hour of fighting with that dressing mod, lol .. thank you, now i did it with 1 line in my CSS instead.
9 Oct 2007, 8:54 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Sidebox contents hover background colour

Yes, there are certain styling effects that can be done fine without Cat Dressing. No need for a shotgun when a BB gun will do the job.

5 Nov 2007, 3:18 AM
#8
crabdance avatar

crabdance

Zen Follower

Join Date:
Sep 2007
Posts:
318
Plugin Contributions:
0

Re: Sidebox contents hover background colour

gjh42:

Yes, there are certain styling effects that can be done fine without Cat Dressing. No need for a shotgun when a BB gun will do the job.

so true, so true... Thank you Glenn for this information. I have learned something new about CSS stuff. I did not know about the "block" command. I was able to add it to my stylesheet_betterCategoriesEZinfo.css file and everything worked great. Things didn't go so good when I put the changes in my stylesheet.css but now everything is working great!

Thanks so much for the info! I now have images with rollover effects now.