Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Senior Member Tech0rz's Avatar
    Join Date
    Aug 2004
    Location
    Northwest, Eng
    Posts
    128
    Member #
    7314
    Hi, I'm having some trouble trying to get this:
    Web Page As It Is Now

    ...to look/work like this:
    http://www.audity.pwp.blueyonder.co....eft-normal.gif

    Here's the CSS for that menu:

    Code:
    /* navigation left
    ==============================================================================*/
    #nav_left {
    	background: url(images/nav_left_bg.gif) right repeat-y;
    	position: relative;
    	width: 14em;
    	top: 16px;
    	left: 24px;
    	}
    h1#menu {
    	background: url(images/nav_left_header.gif) bottom right no-repeat;
    	width: 14em;
    	height: 16px;
    	margin-bottom: 10px;
    	text-indent: -9000px;
    	}
    
    /* all menu items
    ==============================================================================*/
    #nav_left ul {
    	margin-left:1em;
    	line-height: 2.4em;
    	font-family: arial, tahoma, verdana, sans-serif;
    	font-size: 1em;
    	font-weight: 900;
    	color: #717171;
    	letter-spacing: 0.1em;
    	}
    
    /* menu links
    ==============================================================================*/
    #nav_list ul, li a {
    	display:block;
    	height: 2.3em;
    	color: #717171;
    	vertical-align:text-top;
    	}
    	#nav_list ul, li a:hover {
    		color: #5296B2;
    		background-color: white;
    		border-top: 1px solid #E6E6E6;
    		border-bottom: 1px solid #E6E6E6;
    	}
    
    /* menu sub-items
    ==============================================================================*/
    #nav_left ul ul li {
    	font-weight: normal;
    	letter-spacing: 0.05em;
    	}
    #nav_left ul ul li a {
    	background: url(images/bullet.gif) left center no-repeat;
    	padding-left:2em;
    	}
    #nav_left ul ul li a:hover {
    	background-color:white;
    	}
    	#nav_left ul li#active a {
    		display:block;
    		background-color: white;
    		border-top: 1px solid #E6E6E6;
    		border-bottom: 1px solid #E6E6E6;
    		color: #B5CA6A;
    		font-weight:bold;
    		}
    The problems are:
    • The 1px solid borders on the a:hover cause the list items above and below to nudge out by 1px each.
    • The main menu items display correctly on hover (the white bg and borders expand to both sides of the containing div) but the sub-items bg and border starts where the text starts.


    If you could help me with any of these issues I would appreciate it.

    Thanks

    p.s. if you want the full CSS file just ask
    Attached Images Attached Images

  2.  

  3. #2
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Well, it seems like you might be setting too wide a left padding for the li elements. Keep in mind that that padding includes the actual bullet image, so you should reduce it by that much.

  4. #3
    Senior Member Tech0rz's Avatar
    Join Date
    Aug 2004
    Location
    Northwest, Eng
    Posts
    128
    Member #
    7314
    Update: (code in 1st post updated)

    I've managed to fix some issues (for reference purposes I used "background-image" instead of "list-style-image" to fix the width problem). I still can't figure out a way to stop the 1px margin when hovering from nudging the adjacent list items out. I tried adding a white 1px border to the items then changing the colour on hover but you can see the white border on top of the vertical shadow on the right of the containing box.

    If anyone can suggest a solution I'd love to hear it.

    Thanks

  5. #4
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Try giving the link a set height and then changing that height by 1px on hover (i.e., make it 1px shorter to compensate for the 1 extra border pixel).

  6. #5
    Senior Member Tech0rz's Avatar
    Join Date
    Aug 2004
    Location
    Northwest, Eng
    Posts
    128
    Member #
    7314
    Quote Originally Posted by Shadowfiend
    Try giving the link a set height and then changing that height by 1px on hover (i.e., make it 1px shorter to compensate for the 1 extra border pixel).
    Thanks, but although that seemed to work in Firefox, the problem remained in IE. However, I have fixed the problem! I don't know what I didn't think of this earlier, I could have saved a lot of time.

    I simply added 1px top/bottom padding to list items and removed it on hover; the borders replace the padding and hey presto.

    Thanks for the help.

  7. #6
    Senior Member
    Join Date
    Jun 2005
    Location
    Atlanta, GA
    Posts
    4,146
    Member #
    10263
    Liked
    1 times
    Ah, excellent. Yep, that makes perfect sense


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 07:35 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com