Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: css menu

  1. #1
    New Coder twistedsoul's Avatar
    Join Date
    Jul 2008
    Location
    UK
    Posts
    94
    Thanks
    3
    Thanked 1 Time in 1 Post

    css menu

    I've never actually done this before, but I have a css menu but I want to make it so when I'm on a certian page it stays highlighted. I'm using a php include for my pages so i was wondering if their is a way to do this?

    here's the css

    Code:
    a.nav, a.nav:link, a.nav:visited {
    	display:block;
    	width:90px;
    	height:84px;
    	text-align:center;
    	text-decoration:none;
    	font-family:verdana, arial, sans-serif;
    	font-size:14px;
    	color:#FFFFFF;
    	line-height:90px;
    	overflow:hidden;
    	float:right;
    	font-weight: 300;
    }
    
    a.nav:hover {
    	color:#FFFFFF;
    	background-image:url(../images/nav.gif)
    } 
    
    a.nav:active {
    color:#fff;
    background:#c00;
    }
    I tried using :focus but it had no effect.
    Whatever you do, do not click me!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,849
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder twistedsoul's Avatar
    Join Date
    Jul 2008
    Location
    UK
    Posts
    94
    Thanks
    3
    Thanked 1 Time in 1 Post
    thanks, tho I've had a little trouble ipmlement that into my code :s
    Whatever you do, do not click me!

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello twistedsoul,
    I have a demo of it up at http://nopeople.com/CSS/h_ul_menu-wi...ges/index.html
    Maybe that will help? I thought rmedek did a pretty good job explaining it in that post ab linked you to, but sometimes it helps to see it in action.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

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