Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Senior Member
    Join Date
    Jan 2014
    Posts
    392
    Member #
    38172
    Liked
    4 times

    image hover as image??

    im using an image as a link, how do i set it in css to hover a different image?

    anything ive looked up is

    img:hover {
    background: url('facebook1.jpg')
    }

    but its not working, i tried different directories like ../pics/facebook1.jpg

    what am i doing wrong??

  2.  

  3. #2
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,482
    Member #
    425
    Liked
    2783 times
    a:hover is for links. I'd say that's your issue.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  4. #3
    Senior Member
    Join Date
    Jan 2014
    Posts
    392
    Member #
    38172
    Liked
    4 times
    nope tried that :/

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,772
    Member #
    5580
    Liked
    723 times
    See this working example:
    Edit fiddle - JSFiddle


  6. #5
    Senior Member
    Join Date
    Jan 2014
    Posts
    392
    Member #
    38172
    Liked
    4 times
    doesnt help, ive tried every possability as far as i can tell


    a img:hover{
    background: url("../pics/facebook1.jpg");
    }

    ive tried it with ",' and without, ive tried background-image and ive tried different directories.. anyone see where im going wrong?

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,772
    Member #
    5580
    Liked
    723 times
    Where are you trying it? What test page is it on?


  8. #7
    Senior Member
    Join Date
    Jan 2014
    Posts
    392
    Member #
    38172
    Liked
    4 times
    i just uploaded it to

    learning this ****

    before i made changes to the page the top wrapper covered 100% width and now its not, and also its not centering. will this stuff ever just be ****ing easy :/

  9. #8
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,482
    Member #
    425
    Liked
    2783 times
    Nope. Won't be. That's not sarcasm, either...the very nature of design and development means it's going to be difficult and you're going to have to struggle with it if you ultimately want to be good at it. So suck it up.
    Code:
    li img a:hover{background: url('../images/facebook1.jpg') no-repeat center center fixed;;}
    You've got the img and the a backwards. img is a child element of a, not the other way around.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  10. #9
    Senior Member
    Join Date
    Jan 2014
    Posts
    392
    Member #
    38172
    Liked
    4 times
    i tried that one aswell still not working.. WTF?

  11. #10
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,482
    Member #
    425
    Liked
    2783 times
    You didn't read what I said...I didn't give you the answer on purpose. I told you where the problem was in your code. So you copied and pasted what I gave you blindly, found it didn't work (which it wasn't going to because it's the same as your non-working code) and got mad rather than taking 20 seconds to actually read the explanation.

    This is why you're so frustrated right now...you're not really trying. You're thinking, "hey, every time I get stuck, I can just come on here, post a complaint, **** and moan for a while, and someone will help me." That's not how things like this work, and the act is getting old, dude. That's why most of the time I don't even answer or try to help you even if I could, and I know I'm not the only one..it's because you're usually all "this isn't working GRRRR it should work GRRRR I coded it right WTF someone tell me the answer GRRRR."

    So...look at what I posted. Read it properly. Do what I told you to do the first time. Show that you did it. And if you're still legitimately stuck and you've tried things, ask nicely for clarification.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:00 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com