Grow your CSS skills. Land your dream job.

Put an Image behind every link (Solved)

  • # January 17, 2009 at 7:35 am

    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

    # January 17, 2009 at 8:07 am

    do it within the css for your links:
    a
    {
    background-image:url(whereveryourimageis);
    }

    # January 17, 2009 at 8:27 am

    ok, sorry i don’t mean as an backgroundimage, but after every link.
    like this:

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

    thanks

    # January 17, 2009 at 9:13 am
    "egalegal" wrote:
    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?

    # January 17, 2009 at 9:58 am
    Code:
    a {
    background: url(“link.png”) no-repeat 100% 50%;
    padding-right: 15px; /* the width of your image */
    }
    # January 17, 2009 at 10:42 am

    wow, thanks a lot iopet
    exactly what i’m looking for.
    problem solved

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".