<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

        display specific div on hover? using css and html only(在悬停时显示特定的div?仅使用 css 和 html)
          <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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Move link image 5px up on hover(悬停时将链接图像向上移动 5px)
                  How do I inspect CSS pseudo classes with firebug?(如何使用 firebug 检查 CSS 伪类?)
                  Why doesn#39;t CSS hover work on table rows when the cells inside the rows have class names?(当行内的单元格具有类名时,为什么 CSS 悬停在表格行上不起作用?)
                  Hover image - display div over it(悬停图像 - 在其上显示 div)
                  How to apply a CSS class on hover to dynamically generated submit buttons?(如何在悬停时将 CSS 类应用于动态生成的提交按钮?)
                  Differences between CSS3 :hover and :focus?(CSS3 :hover 和 :focus 的区别?)

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

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

                          <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>