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

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

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

        • <bdo id='Oqbw7'></bdo><ul id='Oqbw7'></ul>

        <tfoot id='Oqbw7'></tfoot>
      2. 在 CSS 中的悬停覆盖图像上

        时间:2023-11-29
            <bdo id='HMm8t'></bdo><ul id='HMm8t'></ul>

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

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

                <tbody id='HMm8t'></tbody>

              1. <tfoot id='HMm8t'></tfoot>
                  本文介绍了在 CSS 中的悬停覆盖图像上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要一个带有图片 bg 的 div 来在悬停时覆盖图像(具有一定的透明度).我需要能够有一个透明的覆盖层,可以在整个站点的任何图像上使用和重复使用.至少可以说,我的第一次尝试是迂回的.因为我发现你不能翻转一个不可见的 div 我设计了一个三明治系统,其中原始图像是第一层,叠加层是第二层,原始图像又是第三层.这样,当您翻转时,原始图像会消失,从而在原始图像上显示叠加图像:

                  I need a div with picture bg to overlay an image (with some amount transparency) when hovered on. I need to be able to have one transparent overlay that can be used and reused throughout the site on any image. My first attempt was round-about to say the least. Because I found out you cannot roll-over an invisible div I devised a sandwhich system in which the original image is the first layer, the overlay is the second layer, and the original image is third layer again. This way, when you roll-over, the original image disappears revealing the overlay image over the original image:

                  http://www.nightlylabs.com/uploads/test.html

                  所以它起作用了.有点.由于您无法与可见性交互:不可见元素(为什么?!)除非您将光标放在它上面,否则翻转会闪烁.

                  So it works. Kinda. Because of you cannot interact with an visibility:invisible element (why?!) the roll-over flickers unless you rest the cursor on it.

                  有什么帮助吗?这种方法不好,如果有人有更好的方法,请发表评论.

                  Any help? This method is bad so if anyone has a better one please comment.

                  推荐答案

                  我用了下面的css,没问题.

                  I used the following css and its fine.

                  #container { position:relative; width:184px; height:219px;}
                      .image { background-image:url(alig.jpg); position:absolute; top:0; left:0; width:184px; height:219px; z-index:2;}
                      .overlay { background-image:url(aligo.png); position:absolute; top:0; left:0; width:184px; height:219px; z-index:3;}
                      .top-image { background-image:url(alig.jpg); position:absolute; top:0; left:0; width:184px; height:219px; z-index:4;}
                      .top-image:hover { background-image:none;}
                  

                  这篇关于在 CSS 中的悬停覆盖图像上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:通过 CSS 将鼠标悬停在父元素上时显示 :after 下一篇:使用 jQuery 模拟悬停

                  相关文章

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

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

                  1. <tfoot id='Pr9JW'></tfoot>
                      <legend id='Pr9JW'><style id='Pr9JW'><dir id='Pr9JW'><q id='Pr9JW'></q></dir></style></legend>
                        <bdo id='Pr9JW'></bdo><ul id='Pr9JW'></ul>