<bdo id='0gTIQ'></bdo><ul id='0gTIQ'></ul>
<tfoot id='0gTIQ'></tfoot>
    <i id='0gTIQ'><tr id='0gTIQ'><dt id='0gTIQ'><q id='0gTIQ'><span id='0gTIQ'><b id='0gTIQ'><form id='0gTIQ'><ins id='0gTIQ'></ins><ul id='0gTIQ'></ul><sub id='0gTIQ'></sub></form><legend id='0gTIQ'></legend><bdo id='0gTIQ'><pre id='0gTIQ'><center id='0gTIQ'></center></pre></bdo></b><th id='0gTIQ'></th></span></q></dt></tr></i><div id='0gTIQ'><tfoot id='0gTIQ'></tfoot><dl id='0gTIQ'><fieldset id='0gTIQ'></fieldset></dl></div>

    1. <legend id='0gTIQ'><style id='0gTIQ'><dir id='0gTIQ'><q id='0gTIQ'></q></dir></style></legend>

      <small id='0gTIQ'></small><noframes id='0gTIQ'>

      1. 在悬停时显示特定的div?仅使用 css 和 html

        时间:2023-11-29
          <tbody id='0HF0s'></tbody>
        <legend id='0HF0s'><style id='0HF0s'><dir id='0HF0s'><q id='0HF0s'></q></dir></style></legend>
        <i id='0HF0s'><tr id='0HF0s'><dt id='0HF0s'><q id='0HF0s'><span id='0HF0s'><b id='0HF0s'><form id='0HF0s'><ins id='0HF0s'></ins><ul id='0HF0s'></ul><sub id='0HF0s'></sub></form><legend id='0HF0s'></legend><bdo id='0HF0s'><pre id='0HF0s'><center id='0HF0s'></center></pre></bdo></b><th id='0HF0s'></th></span></q></dt></tr></i><div id='0HF0s'><tfoot id='0HF0s'></tfoot><dl id='0HF0s'><fieldset id='0HF0s'></fieldset></dl></div>

        <small id='0HF0s'></small><noframes id='0HF0s'>

            • <bdo id='0HF0s'></bdo><ul id='0HF0s'></ul>
              <tfoot id='0HF0s'></tfoot>
                1. 本文介绍了在悬停时显示特定的div?仅使用 css 和 html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想显示第二个 div(在 HTML 中),类 dikha 将光标悬停在锚标记上.

                  I want to show second div (in HTML) with class dikha on cursor hover over anchor tag.

                  HTML 代码:

                  <a>Hover over me!</a>
                  <div class="faraz"> sdjfg </div>
                  <div class="dikha">Stuff shown on hover</div>
                  

                  风格

                  div {
                  display: none;
                  }
                  
                  a:hover > div:nth-child(2) {
                  display: block;
                  background-color: RED;
                  height: 250px;
                  width: 960px;
                  }
                  

                  推荐答案

                  需要使用相邻兄弟选择器~.此外,您要显示的 div 是第三个孩子,而不是第二个(因为 <a> 是第一个).

                  You need to use the adjacent siblings selector ~. Also, the div you want to show is the third child, not the second (because the <a> is the first).

                  div {
                      display: none;
                  }
                  a:hover ~ div:nth-child(3) {
                      display: block;
                      background-color: RED;
                      height: 250px;
                      width: 960px;
                  }
                  

                  演示:http://jsfiddle.net/3eFhf/

                  这篇关于在悬停时显示特定的div?仅使用 css 和 html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何防止鼠标在悬停元素之外滚动? 下一篇:CSS:将鼠标悬停在多个放置在另一个上的 div 上时显示样式

                  相关文章

                  <small id='KH8cM'></small><noframes id='KH8cM'>

                  1. <tfoot id='KH8cM'></tfoot>

                      <i id='KH8cM'><tr id='KH8cM'><dt id='KH8cM'><q id='KH8cM'><span id='KH8cM'><b id='KH8cM'><form id='KH8cM'><ins id='KH8cM'></ins><ul id='KH8cM'></ul><sub id='KH8cM'></sub></form><legend id='KH8cM'></legend><bdo id='KH8cM'><pre id='KH8cM'><center id='KH8cM'></center></pre></bdo></b><th id='KH8cM'></th></span></q></dt></tr></i><div id='KH8cM'><tfoot id='KH8cM'></tfoot><dl id='KH8cM'><fieldset id='KH8cM'></fieldset></dl></div>
                    1. <legend id='KH8cM'><style id='KH8cM'><dir id='KH8cM'><q id='KH8cM'></q></dir></style></legend>
                        <bdo id='KH8cM'></bdo><ul id='KH8cM'></ul>