SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem having 2 images as background

    Hello,
    I am new to CSS. I’m having a problem with the background image. Infact I used 2 images for the background and I need to make the second image as link (ONLY THE SECOND IMAGE). I have tried lot of methods, but it makes both images as link, but i need only the second image to be a link (href). Here is the css :

    #header {
    height: 34px;
    background-color : #000000;
    position: relative;
    background-image:url(../images/BARRE_GALACTIQUE_PICTOS_Carte.png), url(../images/rechercher.png);
    background-repeat:no-repeat;
    background-position: 5px center, 775px center;
    }
    Any help please…….

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,789
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Hi,

    You would need to position an empty anchor over the image to make this work which means you would be better of applying the second image to an anchor instead and placing it into position.

    The only other way assuming #header is already an anchor would be to place an element over the part that you don't want to be a link and block it off but again you are adding extra elements to do this.

    if #header is a wrapper and not the anchor itself then you could use :after to construct a box to sit on top of the part that shouldn't be a link but then again that would assume that you have an inner anchor element so there is no point as the anchor could already be used.

    You will have to clarify the html to get a straight answer

  3. #3
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks

    hi paul,

    Thanks for ur reply. I'll give a try and let u know.


Tags for this Thread

Bookmarks

Posting Permissions

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