Well, something like this:

alt text

alt text

    4 answers 4


    .block-to-show { display: none; } .link-to-hover:hover ~ .block-to-show { display: block; } 
     <a class="link-to-hover">Hover me to see the block</a> <p>Anything else</p> <p class="block-to-show">This block is shown only when the link is hocered</p> 

       <style> .some_block{ display:none; } a:hover .some_block{ display:block; } </style> <a href="#">some url<div class="some_block">some block</div></a> 
      • 2
        @FLK 1. there is no approach to game browsers 2. the block will pop up when you hover on any <a> tag 3. probably better to use javascript ? 4. Why so give an example? I personally do not doubt your abilities, but this decision is the worst! - Palmervan
      • And in my opinion a normal test case. Although I suspect that OPA has a somewhat loose terminology regarding the “block” and meant a: hover {outline: thick} - karmadro4
      • 3
        @Palmervan m. Should I write a site right away? I showed the principle of action, and the use is always at the discretion of the person asking the question, regarding js, that I did not notice the javascript tags in the question. ps what is that for the browser that does not support css2? And is there any sense in crutches for them? - FLK
      • @ karmadro4 you can guess as much as you want .. we will wait for a psychic, or when @koko deigns to clarify the question. - FLK
      • @FLK The bottom line is that the vehicle will inherit your principle of action and again ask a dozen questions on the same subject! Regarding the tags, although they are not indicated in the question, this does not mean that the vehicle asking the question has an idea of ​​what javascript is, but using the familiar onmouseover | out functions is not a crutch! On an example, when I first became acquainted with html and css, javascript seemed unreachable. This is the same case! - Palmervan
       <a id="link" href="href">lnk</a> <div id="bk">fea</div> <script> var lnk=document.getElementById("link"); var bk=document.getElementById("bk"); lnk.onmouseover=function(){bk.style.visibility="visible"} lnk.onmouseout=function(){bk.style.visibility="hidden"} </script> <style> #bk{ position: absolute; top: 60px; left: 60px; width: 60px; height: 30px; background-color: #000000; visibility: hidden; } </style> 
      • hm ... and where at you event used inside an anonymous function? or am I misunderstood? - Palmervan
      • Just for the debility browsers so that they do not give out errors! - Rules
      • drank today? this is nothing more than a local variable which) - Palmervan
       отсутствует подход к дыбилобраузерам блок будет выскакивать при наведении на любой тег <a> наверное лучше использовать javascript? зачем так приводить пример? лично я не сомневаюсь в твоих способностях, но это решение самое ужасное! 

      Everything will work there normally

      a: hover .some_block

      This design indicates that it is for the block inside this particular A.

      • The selector is friendly to the old UA, but the markup is invalid (block in the inside line element). But I remain in the opinion that the test case is satisfactory, and the criticism quoted is not directly relevant. - karmadro4