treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Put an Image behind every link (Solved)

  • hi,
    i'm asking if its possible to put automatically an image (link arrow) behind every link in an document. (without writing the whole time <img src ...>)
    can i realise something like that with css, or should i use JS?

    thanks for any kind of answers
  • do it within the css for your links:
    a
    {
    background-image:url(whereveryourimageis);
    }
  • ok, sorry i don't mean as an backgroundimage, but after every link.
    like this:

    www.someadress.com (picture)

    thanks
  • "egalegal" said:
    ok, sorry i don't mean as an backgroundimage, but after every link.
    like this:

    http://www.someadress.com (picture)

    thanks


    well why not make your link that wee bit bigger, and position the image to the right hand side of the link, that way the background image could work.
    is it the same image?

    you could make an image a certain size, but add the image you want to the right hand side, that way you always have your image...

    but your question is vague as to what exactly you want it to do... e.g. just link, on hover, on focus, on active?
  • a {
    background: url(\"link.png\") no-repeat 100% 50%;
    padding-right: 15px; /* the width of your image */
    }
  • wow, thanks a lot iopet
    exactly what i'm looking for.
    problem solved