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

    <bdo id='JlsCr'></bdo><ul id='JlsCr'></ul>

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

        在 HTML 中,如何在将鼠标悬停在文本上时显示图像?

        In HTML, how can you make an image appear while you are hovering over text?(在 HTML 中,如何在将鼠标悬停在文本上时显示图像?)
      1. <i id='6TWF4'><tr id='6TWF4'><dt id='6TWF4'><q id='6TWF4'><span id='6TWF4'><b id='6TWF4'><form id='6TWF4'><ins id='6TWF4'></ins><ul id='6TWF4'></ul><sub id='6TWF4'></sub></form><legend id='6TWF4'></legend><bdo id='6TWF4'><pre id='6TWF4'><center id='6TWF4'></center></pre></bdo></b><th id='6TWF4'></th></span></q></dt></tr></i><div id='6TWF4'><tfoot id='6TWF4'></tfoot><dl id='6TWF4'><fieldset id='6TWF4'></fieldset></dl></div>

        <legend id='6TWF4'><style id='6TWF4'><dir id='6TWF4'><q id='6TWF4'></q></dir></style></legend>
          <tbody id='6TWF4'></tbody>
          <tfoot id='6TWF4'></tfoot>
              <bdo id='6TWF4'></bdo><ul id='6TWF4'></ul>

                <small id='6TWF4'></small><noframes id='6TWF4'>

                1. 本文介绍了在 HTML 中,如何在将鼠标悬停在文本上时显示图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 HTML 中,当我将鼠标悬停在特定文本部分上时,如何使图像出现(或变得可见)?我正在编写一个 HTML 应用程序,以下是我的代码:

                  In HTML, how can I cause an image to appear (or become visible) while I'm hovering over a specific section of text? I'm coding an HTML app, and the following is my code:

                          .plank1 {
                               position: static;
                               left: 80px;
                               top: 100px;
                               visibility: visible;
                          }
                  
                          .plank1appear:hover .plank1{
                               visibility: visible;
                          }
                  

                  推荐答案

                  要在将鼠标悬停在整段文本上时显示图像,您可以在 hover 上显示和隐藏图像:

                  To show an image when you hover over a whole section of text you can show and hide the image on hover:

                  CSS

                  img{
                     display: none
                  }
                  
                  p.one:hover + img{ //img is a sibling
                     display: block;
                  }
                  
                  p.two:hover img{ //image is a child
                     display: block;
                  }
                  

                  HTML

                  <p class="one">HOVER OVER ME - IMG IS SIBLING</p>
                  <img src="http://www.placecage.com/100/100"/>
                  
                  
                  <p class="two">HOVER OVER ME -IMG IS CHILD
                     <img src="http://www.placecage.com/100/100"/>
                  </p>
                  

                  示例

                  如果您想将鼠标悬停在文本的特定部分上,您可以将文本包装在 span 中,并将图像设为该 span 的同级或子级:

                  If you want to hover over a specific part of the text, you can wrap the text in a span and just make the image a sibling or child of that span:

                  HTML

                  <p>This is some text. <span>HOVER OVER ME</span>
                     <img src="http://www.placecage.com/100/100"/>
                  </p>
                  

                  CSS

                  img{
                     display: none
                  }
                  
                  span:hover + img{
                     display: block;
                  }
                  

                  示例二

                  这篇关于在 HTML 中,如何在将鼠标悬停在文本上时显示图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                  How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社
                  Scale background image to fit ie8 window(缩放背景图像以适合 ie8 窗口)
                  @fontface in IE7 (IETEster) not working properly(IE7 (IETEster) 中的@fontface 无法正常工作)
                  Safari 5.1 breaks CSS table cell spacing(Safari 5.1 打破 CSS 表格单元格间距)
                  Put in bold part of description in metatag Drupal module(将描述的粗体部分放在元标记 Drupal 模块中)
                  • <bdo id='YRAq2'></bdo><ul id='YRAq2'></ul>

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

                        <tbody id='YRAq2'></tbody>

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