Solved

css change container image on hover

Posted on 2013-11-04
4
270 Views
Last Modified: 2013-11-08
Hi guys,

I am trying to get the container image to change here (http://www.deans-place.co.uk/problem.html) using :hover.

Firstly any idea why its not working? And secondly, I have a feeling each of my divs inside the container will try to take on the :hover background? which obv I don't want.

Thanks,
Dean
0
Comment
Question by:deanlee17
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 39621154
If you're talking about the .Homepage_Container1, then this will do it:

.Homepage_Container1:hover {
   background-image: url('someImage.jpg');
}

Open in new window

0
 
LVL 1

Expert Comment

by:Chris--W
ID: 39621190
The other option is to use HTML rather than CSS, since your images aren't backgrounds:

<img src="image1.gif"
onmouseover="this.src='image2.gif'"
onmouseout="this.src='image1.gif'"> 

Open in new window

0
 

Author Comment

by:deanlee17
ID: 39621205
I think ChrisStanyon is correct here as the container image is a background image. But a useful tip from Chris-W.

Thanks guys.
0
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 39621213
FYI - dropping javascript in-line is not really considered best practice anymore.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question