Solved

Hover not working

Posted on 2012-04-12
1
187 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
1 Comment
 
LVL 8

Accepted Solution

by:
X-treem earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When writing CSS, there are a few simple rules that will make your life easier.    1. Using ‘* {box-sizing:border-box;}’. Using this will wrap all your elements in a nice little compact box-model that will give you the width you want, like so... …
This article discusses four methods for overlaying images in a container on a web page
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now