Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8365467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:39:46+00:00 2026-06-09T12:39:46+00:00

I am so befuddled. I am trying do something seemingly so simple but failing

  • 0

I am so befuddled. I am trying do something seemingly so simple but failing miserably. I’d like to have the image “b.png” change to “c.png.” Can you find where I went wrong?

index.html

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="style.css" />
</head> 
<body>
    <div class="main">
        <img src="b.png" />
    </div>
</body>
</html>

style.css

.main:hover {
    background-image: url('c.png');
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:39:48+00:00Added an answer on June 9, 2026 at 12:39 pm

    Your <div class="main"> is getting c.png as its background – you just can’t see it behind the <img src="b.png"> element.

    Try removing that <img> tag, and using this for your CSS:

    .main {
        background-image: url(b.png);
    }
    
    .main:hover {
        background-image: url(c.png);
    }
    

    You probably also need to give .main a height and width, since it no longer has anything inside it to give it a size.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have had a little experience with CSS but am always befuddled when I
okay, i'm a bit befuddled with this error. What i'm trying to do here
I am a tad befuddled. I can't reason why the following works: AcceptVerbs(HttpVerbs.Post)] public
I am befuddled over what I think is a very simple and straight forward
I'm still befuddled by the NodeList object in Mootools, and I'm hoping someone can
I have got myself quite befuddled. I have some code which takes some images,
This is my first attempt to write shorthand if statements however am befuddled by
I am trying to get a handle on the state of the art regarding
I have a .Net 3.5 web service that installs perfectly on my old XP
I'm trying to figure out how to properly store foreign keys when the key

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.