SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Sep 2008
    0 Post(s)
    0 Thread(s)

    <a href="">Anchor</a> into image

    This is a strange request, but hear goes:

    I have a file which has this in it:
    <a href="" class="google-link">Go to Google</a>
    // * it's not Google, but it gives an idea of what I am doing
    I then include that file in about five different sites (save re-writing it). There's more going on but this helps to explain it easier.

    Each of the sites can then have this in its own CSS file:
    .google-link {
    color: red;
    /* etc. */

    Can I style it with an image and get rid of the text using only CSS? That way some sites can have the text link and some can have a bespoke image and I won't have to change the include file.

    I can of course just change it and write specific HTML for each site, but thought I would ask!

  2. #2

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Melbourne, AU
    463 Post(s)
    8 Thread(s)
    You can use a simple image replacement technique, as demonstrated here:

    Just add in an empty span (or other inline element like <b></b> and use CSS to position this over the text.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts