Posted: 6/14/2011
Is it possible to exclude just a single link from a CSS hover effect?
Posted: 6/15/2011
Mike Riemer said: Is it possible to exclude just a single link from a CSS hover effect?
Hi Mike,
Please explain what do you mean by '...exclude just a signle link' ?
Thanks,Hajan
To clarify; I meant that I had used A CSS style to create a color change on hover. But I had actually a login status control I wanted to exclude.
Actually I found an easier solution to my problem. I has used a css style for a hover effect(just changing the color on hover). I was using a login status control to show the word "Welcome". This way it would only be visable when the user was logged in(I set the logged out text to ""). The problem was the hover effect was changing the color of the word "Welcome". So what I ended up doing was setting the forecolor to the same as the hover color. That way it appears not to change. I cannot remember how, but I made it so it can't be clicked, so it looks static to the end user but only appears when logged in.
Thanks.
Ahh... I see...
Well, when creating CSS rules for HTML elements that the style should apply or not, you should have in consideration where and how it will affect.
If you put hover on anchor tags, like a and a:hover styles, then you may want for some anchor tags to exclude the hover, you can add .nohover class and apply the same style as in the normal state.
Example
<style> a { color:red; } a:hover { color: blue; } a:hover.nohover { color: red; } </style> <a href="#">Hajan</a><br /> <a href="#" class="nohover">Hajan - no hover</a>
So, you will just need to add class="nohover" to the elements where you don't want the hover style and you are all done.
Hope this helps,Hajan
WOW that was exactly what I was looking for! Thanks I am sure that will be very valuable to me in the future.
Thanks
Mike Riemer said: WOW that was exactly what I was looking for! Thanks I am sure that will be very valuable to me in the future.Thanks
Nice :)! I'm glad my reply was helpful.
Don't forget to Mark As Answer the posts that helepd you resolve your problem or gave you idea of howto resolve it ;)!