Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hover button ?

Status
Not open for further replies.

occas

Technical User
Jan 14, 2004
164
US
A.buttons2:Link {

color:black;
text-decoration:none;
font: 11pt "Times New Roman", serif;
}

A.buttons2:Visited {

color:black;
text-decoration:none;
font: 11pt "Times New Roman", serif;
}

A.buttons2:Hover {

color:white;
background-color:black;
font: 11pt "Times New Roman", serif;
}
A.buttons1:Link {

color:white;
text-decoration:none;
font: 11pt "Times New Roman", serif;
}

A.buttons1:Visited {

color:white;
text-decoration:none;
font: 11pt "Times New Roman", serif;
}

A.buttons1:Hover {

color:rgb(183,16,16);
background-color:white;
font: 11pt "Times New Roman", serif;
}

the hover button for buttons2 will not show a black background. don't get it. ty.
 
Just tried your setup, works fine.
Code:
<head>
  <LINK rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;cs.css&quot;>
</head>
<body>
  <a href=&quot;[URL unfurl="true"]www.msn.com&quot;[/URL] class=&quot;buttons2&quot;>buttons2 style test</a>
</body>
cs.css resides in the same directory and contains the styles above.
 
i tried the external thing, same directory. i still cannot get a black background for the hover button. i get the white text but background does not change. ty. for buttons2.
 
occas,

What browser are you using? Have you enabled any options to override page-defined style sheets at all?

Dan
 
have looked in ie and mozilla. just downloaded mazilla so it has ie settings(copies them). i looked at ie internet options and don't see anything that should be doing this? do you get white text on black background when hovering with button2 class?
ty.
 
I'm getting white text on black background when hovering with button2 class, IE 6.0
 
oh well i have ie 6 also. got me and ty.
 

Have you changed your windows settings to do anything with accessibility or high-contrast? Sometimes they can also interfere with stylesheets.

Dan
 

Can you post your complete code? I can't think of anything else environmental that it could be... Tough problem!

Dan
 
my problem is that i have some asp.net code mixed in. i know that is it. on the page calling this .css. i want to be able to identify the page i am on. that is no problem with asp.net. then i want to change the color of the selected menu item. i have been using asp.net hyperlinks. if i want to use a regular html anchor, how can i change its class from buttons1 to buttons2?
ty.
 

>> if i want to use a regular html anchor, how can i change its class from buttons1 to buttons2?

Erm... simply change the tag from:

Code:
<a href=&quot;xxx&quot; class=&quot;buttons1&quot;>link</a>

To

Code:
<a href=&quot;xxx&quot; class=&quot;buttons2&quot;>link</a>

Dan
 
in my code, dan. like :
if page = Home then
anchor1.class=&quot;buttons2&quot;

something on that order. ty.
 

Aaah..

Something like this, then:

Code:
document.getElementById('myLink').className = 'button2';

...

<a href=&quot;wibble.html&quot; id=&quot;myLink&quot; class=&quot;button1&quot;>link</a>

That should do the job for you.

Hope this helps,

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top