DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Applying Styles To Certain Anchors

05.07.2007
| 4309 views |
  • submit to reddit
        By specifying a class name before the a: you can restrict anchor css to certain classes.  i.e.:

<style type="text/css" rel="stylesheet">
.hoverpink a:hover { background-color:#fcc }
</style>

Then wrap your anchor tags in div or spans:

<div class="nohover"><a href="/ask.html">
<img src="/Graphics/marker-tray.gif" border="0" width="749" 
alt="whiteboard markers" height="31" /></a></div>