By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,203 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

how to change the color become static after click

P: 1
can some1 help with this code.
can i add in a function like on click. when user click one of the link. the color will change to static from mouse over color. the text need to highligted after click.

thanks



<html>
<head>
<style type="text/css">
<!--

a {
text-decoration:none
}

.close {
visibility:hidden;
width:180px /* menu width */
}

.open1 {
visibility:visible;
border:1 solid #000000; /* menu border color */
background:52D6F7 /* menu bg */
}

.open2 {
border:1 solid #000000; /* down menu border */
background:EDED6D /* down menu bg */
}

.bg1 {
border:1 solid #000000; /* mouse on border */
background:DBDBDB /* mouse on bg */
}

.bg2 {
border:1 solid #000000; /* mouse off border */
background:EDED6D /* mouse off bg */
}

.bg3 {
border:1 solid #001000; /* mouse off border */
background:EDED6D /* mouse off bg */
}
-->
</style>
</head>
<body>
<div style="position:absolute;center:0px; top:150px"> <!-- position setting -->
<table align="center"><tr>

<tr valign="top"><table onMouseOver="this.style.visibility='visible'"
onMouseOut="this.style.visibility='hidden'" class=close>

<td><tr class=open1>Administrator Record</tr></td>
<td><tr class=open2 onMouseOver="this.className='bg1'" onMouseOut="this.className='bg2'"><a href="#.htm">Add New Admin</a></tr></td>
<td><tr class=open2 onMouseOver="this.className='bg1'" onMouseOut="this.className='bg2'"><a href="#.htm">List All Admin's Record</a></tr></td>
<td><tr class=open2 onMouseOver="this.className='bg1'" onMouseOut="this.className='bg2'"><a href="#.htm">Update Admin record</a></tr></td>
</table></tr>


<td valign="top"><table onMouseOver="this.style.visibility='visible'"
onMouseOut="this.style.visibility='hidden'" class=close>

<td><tr class=open1>Administrator Record</tr></td>
<td><tr class=open2 onMouseOver="this.className='bg1'" onMouseOut="this.className='bg2'"><a href="#.htm">Add New Job</a></tr></td>
<td><tr class=open2 onMouseOver="this.className='bg1'" onMouseOut="this.className='bg2'"><a href="#.htm">List All Job's Record</a></tr></td>
<td><tr class=open2 onMouseOver="this.className='bg1'" onMouseOut="this.className='bg2'"><a href="#.htm">Update Job record</a></tr></td>
</table></tr>


</tr></br>
</div></center>
</body>
</html>
Feb 7 '07 #1
Share this Question
Share on Google+
1 Reply


P: 4
Hi,

I'm not sure if I understand you exactly but I think you want one of these CSS pseudo-classes:
a:visited { color: "Your-Colour"; }
a:active { color: "Your-Colour"; }
a:focus { color: "Your-Colour"; }
Look here
Feb 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.