tags:

views:

47

answers:

4

Hello,

This may seem stupid to ask, but I have done on many css coding

#div_iv a:hover

but for darn reason, it does not seem to work now, Googled with results such as

a.hover #div_iv
#div_iv:hover

What exactly is wrong.

Thanks Jean

A: 

Remove the underscore from your CSS.

div#iv a:hover

Then HTML:

<div id="iv"><a href="URL">sometext</a></div>
Kyle Sevenoaks
Your CSS code makes no sense like this, it says something like: select the hover pseudoclass of a link that is in an element `iv` that is a child of something with the ID `div`. To match your HTML, the CSS might look like: `div#iv a:hover` (select the hover pseudoclass of a link in the div element which has id 'iv').
Daan
You're right.. It's first thing in the morning.. Sorry. I'll ammend.
Kyle Sevenoaks
+1  A: 

If you specify a style using #div_iv a:hover, you will see the effect in a code like this:

<div id="div_iv">
  <a href="#">My Link</a>
</div>

If it doesn't work, check in your CSS file if you do not override this declaration, by specifying another link style declaration after this one.

Daan
A: 

The reason it was not working is because the id="div_iv" should have been in the href tag

darn me!!!

Jean
I don't see how this can work with the CSS code that you posted in your question. If the a-element has the id `div_iv`, your CSS should look like `a#div_iv:hover`. Can you post the relevant CSS and HTML snippets of your code?
Daan
it would be<a href="someurl.html" id="div_iv">some link</a>
Jean
A: 

If you are trying to make something in the entire DIV, then use following code:

#divID div:hover

or, if it does not work,

div#divID div:hover

Then, use this HTML code:

<div id="divID">Enter stuff and <a href="link.html">links</a> here.</div>
arik-so