<tfoot id='e2i0i'></tfoot>

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

      <legend id='e2i0i'><style id='e2i0i'><dir id='e2i0i'><q id='e2i0i'></q></dir></style></legend>

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

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

    1. CSS:悬停一个元素,多个元素的效果?

      时间:2023-11-01
    2. <tfoot id='qQVYt'></tfoot>

        1. <legend id='qQVYt'><style id='qQVYt'><dir id='qQVYt'><q id='qQVYt'></q></dir></style></legend>
          • <small id='qQVYt'></small><noframes id='qQVYt'>

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

                <tbody id='qQVYt'></tbody>
                <bdo id='qQVYt'></bdo><ul id='qQVYt'></ul>
              • 本文介绍了CSS:悬停一个元素,多个元素的效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在寻找解决悬停问题的方法.

                I'm looking for a method for my hovering issue.

                <div class="section">
                
                <div class="image"><img src="myImage.jpg" /></div>
                
                <div class="layer">Lorem Ipsum</div>
                
                </div>
                

                现在,图像和图层这两个类都有边框.两者对于正常和悬停都有不同的颜色.有没有办法做到这一点,所以如果我悬停图层类,图层和图像类悬停边框颜色都是活动的?反之亦然?

                Now, both classes, image and layer, have borders. Both have different color for normal and hover. Is there way to make it, so if I hover layer class, both layer and image class hovering border color is active? And vise versa?

                推荐答案

                你不需要 JavaScript.

                You don't need JavaScript for this.

                一些 CSS 可以做到这一点.这是一个例子:

                Some CSS would do it. Here is an example:

                <html>
                  <style type="text/css">
                    .section { background:#ccc; }
                    .layer { background:#ddd; }
                    .section:hover img { border:2px solid #333; }
                    .section:hover .layer { border:2px solid #F90; }
                  </style>
                </head>
                <body>
                  <div class="section">
                    <img src="myImage.jpg" />
                    <div class="layer">Lorem Ipsum</div>
                  </div>
                </body>
                </html>

                这篇关于CSS:悬停一个元素,多个元素的效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:悬停时如何在图像上显示文字? 下一篇:如何在 CSS 中延迟 :hover 效果?

                相关文章

                  <bdo id='3H0uB'></bdo><ul id='3H0uB'></ul>

                1. <small id='3H0uB'></small><noframes id='3H0uB'>

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