Solved

Hover not working

Posted on 2012-04-12
1
186 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
Comment Utility
at first sight this should work, did you put a document declaration in your html code?
(xhtml strict/transitional / html ...)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

771 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