Solved

Hover not working

Posted on 2012-04-12
1
190 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 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

CSS3 Custom checkboxes This article shows how to style the checkbox form element using only CSS. Works in: Chrome, FF, Safari, Opera, IE9+ Uses modernizr.js to check for :checked pseudo class, falling back to plain old checkboxes (IE8 and bel…
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 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…

739 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