Results 1 to 5 of 5

Thread: How to keep the active link "down" ?

  1. #1
    Join Date
    Feb 2010
    Posts
    63
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default How to keep the active link "down" ?

    I want the active link the same as the hover link.
    My example only works in IE7.

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    it seems to be working on firefox.

    By "active" link, do you mean the link that is being used (i.e., clicked on) or the link that matches the page you're on? In CSS terms, "active" means "being used."

    If, on the other hand, you want the "Home" button to look like its pressed down when you are on the home page, you would have to give it a class name (like "down", for example) and then style it using that class.

  3. #3
    Join Date
    Feb 2010
    Posts
    63
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Yes, I want the button to look like its pressed when you are on the page from the link.
    Can you give a little more explanation on how to do this ?

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Assuming the user were on home...

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>NavHead_test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style type="text/css">
    <!--
    
    #menu ul li{
    	display:block;
    	float:left;
    	margin:0;
    	padding:0;
    }
    #menu ul{
    	margin: 0px auto;
    	padding:0;
    	list-style-type:none;
    	width:746px;
    	position:relative;
    	display:block;
    	height:36px;
    	font-size:12px;
    	font-family:Helvetica,Arial,Verdana,sans-serif;
    	border-bottom:4px solid #666666;
    	border-top:1px solid #E6E6E6;
    	background-color: transparent;
    	background-image: url(OFF.gif);
    	background-repeat: repeat-x;
    	background-position: left top;
    }
    #menu ul li a{
    	display:block;
    	float:none;
    	color:#FF0000;
    	text-decoration:none;
    	font-weight:bold;
    	height:24px;
    	text-align: center;
    	padding-top: 12px;
    	padding-right: 20px;
    	padding-bottom: 0;
    	padding-left: 20px;
    	background-color: transparent;
    	background-image: url("DIVIDER.gif");
    	background-repeat: no-repeat;
    	background-position: right top;
    	width: auto;
    	}
    
    #menu ul li a:hover{
    	background-color: transparent;
    	background-image: url(HOVER.gif);
    	background-repeat: repeat-x;
    	background-position: right top;
    	}
    #active_page{
    	background-color: transparent;
    	background-image: url(HOVER.gif);
    	background-repeat: repeat-x;
    	background-position: right top;
    	}
    
    -->
    </style>
    </head>
    <body>
    <span id="menu"><ul>
    <li><a id="active_page" href="#">home</a></li>
    <li><a href="#">catalogus</a></li>
    <li><a href="#">new</a></li>
    
    <li><a href="#">galerij</a></li>
    <li><a href="#">plakinstructies</a></li>
    <li><a href="#">contact</a></li>
    <li><a href="#">faq</a></li>
    </ul></span>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    </body>
    </html>
    Corrections to my coding/thoughts welcome.

  5. #5
    Join Date
    Feb 2010
    Posts
    63
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    this is working !

    <li id="active_page"><a href="#">home</a></li>

Bookmarks

Posting Permissions

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