Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hover not working

Posted on 2012-04-12
1
Medium Priority
?
195 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
Suggested Courses

596 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