Highlight current page

Hello experts.
I need help to highlight the current page in my testmenu.There is a  mlddm > li > a:hover   class that i want to use for li item with class search.I have the body id="search"  but it is not working.
Any help?

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7" />
<title>Untitled Document</title>
<style type="text/css">
body{margin:0;padding:0;}
.divmlddm { /* for IE7/Win */
	background: url(menu/bg.jpg);height:39px;
	margin-left:8px;
	margin-right:8px;
	width:939px;
}
.mlddm
{	margin: 0;
	padding: 0;height:39px;}
.mlddm li{	
    display: inline;
	list-style: none;
	margin: 0;
	padding: 0;
	float: left;white-space: nowrap;
	font: bold 14px arial, sans-serif}
.mlddm li a{
	display: block;
	text-align: center;
	color: #ffffff;
	margin: 0;
	width: auto;
	text-decoration: none;
	white-space: nowrap;
	padding-top: 12px;
	padding-right: 14px;
	padding-bottom: 12px;
	padding-left: 20px;
}

.mlddm > li > a:hover{
    color: #ffffff; background-image:url(mypath/menu/bghover.jpg); background-repeat:repeat-x;
	}
#search .mlddm > li > search a{
    color: #ffffff; background-image:url(mypath/menu/bghover.jpg); background-repeat:repeat-x;
	}
</style>
</head>

<body id="search">
<div class="divmlddm">
      <ul class="mlddm"  id="mlddm" params="0,0,500,fade,200,h" >
       <li><a href="#">TESTTEST</a></li>
 
       <li class="search"><a href="#">TESTTEST</a></li>
       <li class="NOSEPARATOR" id="contact"><a href="#">TESTTEST</a></li>
      </ul>
    <div style="clear:both;"></div>
    </div>

</body>
</html>

Open in new window

LVL 2
PanosAsked:
Who is Participating?
 
Daemon_ByteConnect With a Mentor Commented:
Should it not be

.mlddm li a:hover
and
#search .mlddm li.search a
0
 
PanosAuthor Commented:
This is working.
Thank you
0
 
LZ1Commented:
Actually, try this:
#search .mlddm > li > .search a{  
    color: #ffffff; background-image:url(mypath/menu/bghover.jpg); background-repeat:repeat-x;  
        }  
You needed to specify the class of search right before the anchor tag.
 

<!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>  
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-7" />  
<title>Untitled Document</title>  
<style type="text/css">  
body{margin:0;padding:0;}  
.divmlddm { /* for IE7/Win */  
        background: url(menu/bg.jpg);height:39px;  
        margin-left:8px;  
        margin-right:8px;  
        width:939px;  
}  
.mlddm  
{       margin: 0;  
        padding: 0;height:39px;}  
.mlddm li{        
    display: inline;  
        list-style: none;  
        margin: 0;  
        padding: 0;  
        float: left;white-space: nowrap;  
        font: bold 14px arial, sans-serif}  
.mlddm li a{  
        display: block;  
        text-align: center;  
        color: #ffffff;  
        margin: 0;  
        width: auto;  
        text-decoration: none;  
        white-space: nowrap;  
        padding-top: 12px;  
        padding-right: 14px;  
        padding-bottom: 12px;  
        padding-left: 20px;  
}  
  
.mlddm > li > a:hover{  
    color: #ffffff; background-image:url(mypath/menu/bghover.jpg); background-repeat:repeat-x;  
        }  
#search .mlddm > li > .search a{  
    color: #ffffff; background-image:url(mypath/menu/bghover.jpg); background-repeat:repeat-x;  
        }  
</style>  
</head>  
  
<body id="search">  
<div class="divmlddm">  
      <ul class="mlddm"  id="mlddm" params="0,0,500,fade,200,h" >  
       <li><a href="#">TESTTEST</a></li>  
   
       <li class="search"><a href="#">TESTTEST</a></li>  
       <li class="NOSEPARATOR" id="contact"><a href="#">TESTTEST</a></li>  
      </ul>  
    <div style="clear:both;"></div>  
    </div>  
  
</body>  
</html>

Open in new window

0
 
PanosAuthor Commented:
Thank you
regards
panos
0
 
PanosAuthor Commented:
LZ1.
I did not see your post but i have test this and it is not working
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.