?
Solved

Hover not working

Posted on 2012-04-12
1
Medium Priority
?
193 Views
Last Modified: 2012-04-12
Im trying to get hover working on one of my DIVs, so when the user hovers over the question, the entire DIV is highlighted, to indicate both the question and the answer.

I know I can do it Javascript, but thought it would be just as easy in CSS. I thought I could just use ".divClass:hover", but obviously Im missing something.

My CSS code is:-
<style type="text/css">
	body { text-align: center; }
	
	#surveyTitle { width: 100%; height: 200px; text-align: center; font-size:30px; padding-bottom:30px;}
	#surveyContent { width: 600px; height: 300px; margin-left: auto; margin-right: auto; text-align: left; }
	#surveyFooter { width: 100%; height: 100px; text-align: center; padding-top:30px; }
	
	.question_content { width: 600px; height: 90px;	float: left; }
	.question_content:hover { background-color:red } 
	.question {	width: 600px; height: 5px; }
	.answer { width: 500px; float: left; margin-left: 20px; }
	.answerGroup { width: 250px;	float: left; }
</style>

Open in new window




And then one of the sections is:-
	<div class="question_content">
		<div class="question">How long have you been working for the company?:</div>
		<div class="answer">
			<div class="answerGroup"><input type="radio" name="Q3" value="Less than 1 year">Less than 1 year</div>
			<div class="answerGroup"><input type="radio" name="Q3" value="1-2 Years">1-2 Years</div>
			<div class="answerGroup"><input type="radio" name="Q3" value="2-5 Years">2-5 Years</div>
			<div class="answerGroup"><input type="radio" name="Q3" value="5-10 Years">5-10 Years</div>
			<div class="answerGroup"><input type="radio" name="Q3" value="More than 10 years">More than 10 years</div>
		</div>
	</div>

Open in new window



Thought it would be simple, obviously not! :-S

Any ideas what Im doing wrong?
0
Comment
Question by:tonelm54
[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
1 Comment
 
LVL 8

Accepted Solution

by:
X-treem earned 2000 total points
ID: 37838532
at first sight this should work, did you put a document declaration in your html code?
(xhtml strict/transitional / html ...)
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

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…
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
Suggested Courses
Course of the Month9 days, 18 hours left to enroll

762 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