Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    5
    Plugin Contributions
    0

    Default Cell highlight on rollover - Why is it putting products in new lines?

    Hi all.

    I'm building my first Zen Cart store and I want the cell background to change colour when you hover over it in the What's New section.

    I've managed to get the cell to change colour but for some reason when it does that it puts the products on separate rows.

    The URL is http://www.southamericansupermarket.com

    I've used the following CSS and HTML.

    CSS
    HTML Code:
    .centerBoxContentsNew {
    
    	margin: 1em 0em;
    	
    	background-color: #ffffff;
    	
    	color:#000000;
    	
    }
    	
    .centerBoxContentsNew.on {
    
    	margin: 1em 0em;
    	
    	background-color: #999999;
    	
    	color:#000000;
    	
    }
    HTML
    HTML Code:
    <div class="centerBoxContentsNew" onmouseover="this.className='centerBoxContentsNew on'" onmouseout="this.className='centerBoxContentsNew'"
    Any help or opinions on this would be greatly appreciated. Also if there is a better way of doing this. Thanks.

  2. #2
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: Cell highlight on rollover - Why is it putting products in new lines?

    add this to end of your stylesheet.css

    .centerBoxContentsNew {
    float:left;
    }

    you can do hover using just CSS no need for javascript .

  3. #3
    Join Date
    Apr 2010
    Posts
    5
    Plugin Contributions
    0

    Default Re: Cell highlight on rollover - Why is it putting products in new lines?

    Wow. I spent all day trying to figure it out and the solution is soo simple!

    I'm new to CSS and curious why you need the float attribute when you change the background but not when the page is originally loaded?

    And big thanks, Tony

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

    Default Re: Cell highlight on rollover - Why is it putting products in new lines?

    If the items float correctly without hover, you wouldn't need to add it for the hover state when using the CSS background property.
    Code:
    .centerBoxContentsNew:hover {
    	background-color: #ffffff;
    	color:#000000;
    	}
    You only need to specify the properties that are changing for the hover state.

 

 

Similar Threads

  1. v139h Putting divider lines in sidebox but not for every item
    By lolwaut in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 27 Jan 2012, 08:05 PM
  2. Why is header on three lines?
    By johnybravo in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 19 Jun 2011, 02:25 PM
  3. Why are my lines so close together?
    By curbsidestudiosNET in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 26 Mar 2011, 05:01 PM
  4. putting "featured" products on homepage instead of new
    By michaellunsford in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 27 Oct 2006, 07:36 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