Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2007
    Posts
    75
    Plugin Contributions
    0

    Default 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.

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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:
    Code:
    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;
    	}
    Links are blue, recently visited links are also blue, and hovering links are red.

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

    a.category-top:hover {

    }

    for hover effects.

  3. #3
    Join Date
    Jul 2007
    Posts
    75
    Plugin Contributions
    0

    Default 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.
    Last edited by chabbu; 8 Jul 2007 at 03:48 PM.

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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.
    Last edited by gjh42; 8 Jul 2007 at 04:02 PM.

  5. #5
    Join Date
    Jul 2007
    Posts
    75
    Plugin Contributions
    0

    Default Re: Sidebox contents hover background colour

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

  6. #6
    Join Date
    Oct 2007
    Posts
    29
    Plugin Contributions
    0

    Default Re: Sidebox contents hover background colour

    Quote Originally Posted by gjh42 View Post
    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:
    Code:
    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;
    	}
    Links are blue, recently visited links are also blue, and hovering links are red.

    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.

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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.

  8. #8
    Join Date
    Sep 2007
    Posts
    329
    Plugin Contributions
    0

    Default Re: Sidebox contents hover background colour

    Quote Originally Posted by gjh42 View Post
    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.

 

 

Similar Threads

  1. Shopping Cart Contents Background Colour
    By hockley in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 24 Jan 2009, 09:24 PM
  2. hover colour change
    By travellers in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 13 Dec 2008, 12:08 PM
  3. Main Content Box Colour Vs. Background Colour
    By yoyodyne in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 6 May 2008, 02:50 PM
  4. empty cart sidebox background colour
    By mediathing in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Oct 2007, 02:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg