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

  • 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 }

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>