Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2010
    Posts
    40
    Plugin Contributions
    0

    Default How to simply create this hover on nav?

    Hi, I am just trying to create this hover image for my menu on the left.

    Can someone help explain how I go about this?! Firstly, how do I know what pixel height and width it should be exacfly - where in the code does it tell me?

    And then what do I need to do in order to make it work?

    Here's what I'm after:
    http://www.mypreciousgifts.co.uk/images/nav_hover.jpg

    My code in the 'stylesheet_boxes.css' looks like this: so is it something in here I must edit?

    /* ----------------------- BOXES ------------------------- */

    .box {margin-bottom:20px;}
    .box-head{ background:url(../images/title-bg.gif) no-repeat 4px 0; font-size:20px; line-height:24px; color:#303030; font-weight:bold; padding:2px 0 2px 39px; margin:0;}
    .box-head a{ color:#303030; text-decoration:none;}
    .box-head a:hover{ color:#2c1902;}
    .box-body{ padding:17px 18px 18px 1px;}

    .box ul{ padding:0 0 0 5px; margin:0;}
    .box ul li{ font-size:14px; line-height:20px; padding: 5px 0 5px 23px; padding-left:23px;}
    .box ul li a{ color:#696969;text-decoration:none;}
    .box ul li a:hover{ color:#2c1902; text-decoration:none;}

    .box ol{ padding:0; margin:0; list-style:decimal inside;}
    .box ol li{ font-size:14px; line-height:29px;}
    .box ol li a{ color:#696969;}
    .box ol li a:hover{ color:#2c1902; background:url(../images/list-marker.gif) no-repeat 0 12px; text-decoration:none;}


    .box .name{ display:inline-block; margin:5px 0 10px;}

    /* ----------------------- LISTING BOXES ------------------------- */

    THANKS EVERYONE!

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

    Default Re: How to simply create this hover on nav?

    Add to your stylesheet_boxes.css


    li.category-top:hover, li.category-top_un:hover {background: #abc url(../images/list-marker.gif) no-repeat;}

    Replace list-marker.gif with the name of your bg image, saved in /includes/templates/your_template/images/.

    The code won't tell you directly what size your image should be.
    If you don't know how to find the pixel size to make your image, install the Firefox Web Developer extension. Its Information > Display Element Information button will give you the size of any element you click, along with lots of other info.

  3. #3
    Join Date
    Nov 2010
    Posts
    40
    Plugin Contributions
    0

    Default Re: How to simply create this hover on nav?

    Quote Originally Posted by gjh42 View Post
    Add to your stylesheet_boxes.css


    li.category-top:hover, li.category-top_un:hover {background: #abc url(../images/list-marker.gif) no-repeat;}

    Replace list-marker.gif with the name of your bg image, saved in /includes/templates/your_template/images/.

    The code won't tell you directly what size your image should be.
    If you don't know how to find the pixel size to make your image, install the Firefox Web Developer extension. Its Information > Display Element Information button will give you the size of any element you click, along with lots of other info.
    Hey, thanks so much! much appreciated :)

    I just have a few more questions:

    1) How do I make it so it becomes highlighted whilst hovering the image area and NOT the actual text for the catergory?

    2) How do I change the text from being BOLD once clicked and in that catergory, to just a darker text colour, i.e black.
    Once bold it pushes out the text and it drops down causing the hover image to not fill correctly height wise.

    Thanks again

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

    Default Re: How to simply create this hover on nav?

    Your <a> elements need to be block display so that they will take up the full width of the <li> container.

    li.category-top a, li.category-top_un a {display: block;}

    To change the styling of an element, find the class/id that belongs to it and edit that in the stylesheet... add it if not already there. You can find this info yourself if you have installed the Firefox Web Developer. You will find frequent use for this while building your site.

  5. #5
    Join Date
    Nov 2010
    Posts
    40
    Plugin Contributions
    0

    Default Re: How to simply create this hover on nav?

    Quote Originally Posted by gjh42 View Post
    Your <a> elements need to be block display so that they will take up the full width of the <li> container.

    li.category-top a, li.category-top_un a {display: block;}

    To change the styling of an element, find the class/id that belongs to it and edit that in the stylesheet... add it if not already there. You can find this info yourself if you have installed the Firefox Web Developer. You will find frequent use for this while building your site.
    Thanks again

    I am now using that developer tool and managed to get rid of the bold on the nav, I am however, trying to figure out how I duplicate the nav hover on the other sideboxes? eg/ the information one below? I tried a search for the exact code on dreamweaver but no luck?

    Sorry, coding NOOB!

  6. #6
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,196
    Plugin Contributions
    0

    Default Re: How to simply create this hover on nav?

    Here is for the information Sidebox:

    .box ul li:hover {
    background: url("../images/nav_hover.gif") no-repeat scroll 0 0 #AABBCC;
    }

 

 

Similar Threads

  1. v150 Any ideas how to create hover effect that shows image elsewhere on page?
    By spiggles87 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 5 Mar 2013, 02:55 PM
  2. How do I create this
    By rxalex in forum General Questions
    Replies: 3
    Last Post: 12 Jul 2010, 05:40 AM
  3. How to create this
    By Dutchman in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 15 Sep 2007, 12:33 AM
  4. How can I get my top nav to look like this?
    By mring in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 5 Aug 2007, 02:37 PM
  5. how do i create a sidebox like this
    By lucianman in forum General Questions
    Replies: 1
    Last Post: 23 Oct 2006, 10:18 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