Good evening everyone. Faced such a problem: there is a hidden block with display:none
. At a certain point, I make him display:block
, and the elements inside it when I hover over them need to change the background. Implemented it with the help of a pseudo-class: hover
. All is good, but it works correctly everywhere, except IE. In a donkey, however, the background change is triggered once or on click ... Actually, the question is how to deal with it?
|
2 answers
Push a "div" into "a". hover
for links works everywhere.
<a href="" class="qwerty"><div> что-то </div></a> .qwerty:hover div{ background: #999; }
- no need to do that. This is not valid. It is better to register in css: display: block; - Alex Kapustin
- Or replace div with span. - ling
|
This violates the semantics of the layout. Looking with what and what method you are trying to fight. If the support of 0.4% and 6 is fundamental, then only with scripts, or read about another method here www.umade.ru/log/2004/07/css-hover -any-element /. If you don't need to properly set the doctype. and generally the jQuery hover () method works in all browsers. you just need to add a class of guidance to the element, and after removing the mouse, remove this class.
- In my opinion, the layout has been ruled by Mrs. Anarchy for a long time and
<a><div>
is not a reason for disappointment. Correctly, it was necessary to do about 15 years ago - to refer to Chukotka those who make-up as <s> h </ s> Udak. This is so, a remark to the "semantics") - Sh4dow - I wonder how the anarchy can rule the layout, if xhtml just generated this semantics? All elements should be used on the basis of their purpose. - LeD4eG
|
<a>
- Sh4dow