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

Spice Up A Link With A Background Image

07.05.2011
| 2039 views |
  • submit to reddit
        // the background image is 16x16px

.mylink{
  float:left;
  display: block;
  background: transparent url(myimg.gif) no-repeat scroll 1px 2px;
  padding-left: 20px;
  height:2em;
  line-height:2em;
}


<a href="#" class="mylink">This link is visually more appealing</a>