2

I referred to this post to make my hover work. But solution there is not working for me.

I have HTML like

<div id="top">
<div id="first">
</div>
<div id="second">
</div>
<div id="third">
    <div id="hiddentext">1st div is hovered</div>
</div>
</div>

I have big css file...you can see the fiddle here

Can anyone help me getting my hiddentext visible on hover of "first" div. ​

1 Answer 1

2

Write like this

#first:hover + #second + #third > #hiddentext{
    visibility:visible;
}

Check this http://jsfiddle.net/Q5zt2/17/

Updated

write like this:

#first:hover ~ #third #hiddentext{
    visibility:visible;
}

Check this

http://jsfiddle.net/Q5zt2/20/

Sign up to request clarification or add additional context in comments.

6 Comments

Thats great. Thanks a ton. But why? and how come?
because you define + selector wrongly check this w3.org/TR/CSS2/selector.html#adjacent-selectors
Two questions: why are #first and #second are needed there? and Is there a better way to achieve the same functionality using css only?
for your second question check jsfiddle.net/Q5zt2/20 for your second question check & read the link of w3c which i give you.
@NewAlexandria the HTMl structure is same as above check this jsbin.com/ajeyub/1
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.