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

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

      <tfoot id='Nu46a'></tfoot>

        将 2 个不同的 div 悬停在第三个不同的 div 上

        Move 2 different divs on hover on a third different div(将 2 个不同的 div 悬停在第三个不同的 div 上)

        1. <small id='fv6pP'></small><noframes id='fv6pP'>

          <tfoot id='fv6pP'></tfoot>

            <tbody id='fv6pP'></tbody>
          <legend id='fv6pP'><style id='fv6pP'><dir id='fv6pP'><q id='fv6pP'></q></dir></style></legend>
          <i id='fv6pP'><tr id='fv6pP'><dt id='fv6pP'><q id='fv6pP'><span id='fv6pP'><b id='fv6pP'><form id='fv6pP'><ins id='fv6pP'></ins><ul id='fv6pP'></ul><sub id='fv6pP'></sub></form><legend id='fv6pP'></legend><bdo id='fv6pP'><pre id='fv6pP'><center id='fv6pP'></center></pre></bdo></b><th id='fv6pP'></th></span></q></dt></tr></i><div id='fv6pP'><tfoot id='fv6pP'></tfoot><dl id='fv6pP'><fieldset id='fv6pP'></fieldset></dl></div>
                  <bdo id='fv6pP'></bdo><ul id='fv6pP'></ul>
                  本文介绍了将 2 个不同的 div 悬停在第三个不同的 div 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的页面有 3 个水平放置的 div.当中心 div 悬停时,我需要让 2 个 div 移动到页面的两侧(左 div 向左移动,右 div 向右移动).我可以让左边的 div 移动,但右边的 div 没有移动.我希望使用 CSS 来实现这一点,如果没有请告知.非常感谢.

                  My page has 3 divs that are located horizontally. I need to make the 2 divs move to the sides of the page (left div move to left, and right div move to right) when the center div is on hover. I can make the left div move, but the right div isn't moving. I hope to get this achieved using CSS, if not please advise. Thanks a lot.

                  我的代码如下:

                  .container 
                     {
                      position:absolute; bottom:0; right:0; left:0;
                      margin-right:auto; margin-left:auto;
                      width:50%; height:10%;
                     }
                  .a {position:absolute; bottom:0; left:20px; width:30%;}
                  .b 
                     {
                      position:absolute; bottom:0; right:0; left:0;
                      margin-right:auto; margin-left:auto; width:30%;
                     }
                  .c {position:absolute; bottom:0; right:20px; width:30%;}
                  
                  .b:hover + .a{
                  -moz-transform:translatex(-50px);
                  -ms-transform:translatex(-50px);
                  -o-transform:translatex(-50px);
                  -webkit-transform:translatex(-50px);
                  transform:translatex(-50px);
                  }
                  
                  .b:hover + .c{
                  -moz-transform:translatex(50px);
                  -ms-transform:translatex(50px);
                  -o-transform:translatex(50px);
                  -webkit-transform:translatex(50px);
                  transform:translatex(50px);
                  }
                  
                  <div class="container">
                      <div class="b">Div b</div>
                      <div class="a">Div a</div>
                      <div class="c">Div c</div>
                  </div>
                  

                  推荐答案

                  将选择器从 + 改为 ~:

                  change the selectors from + to ~:

                  .b:悬停~.a{

                  .b:hover ~ .c{

                  .b:hover ~ .c{

                  http://jsfiddle.net/YYhTS/

                  这篇关于将 2 个不同的 div 悬停在第三个不同的 div 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)
                  How to use coffeescript in developing web-sites?(如何在开发网站时使用coffeescript?)
                  Expose a javascript api with coffeescript(使用 coffeescript 公开一个 javascript api)
                  Coffeescript wrapping files in a function(Coffeescript 在函数中包装文件)
                  Multiple Files communication with coffeescript(与咖啡脚本的多个文件通信)
                • <small id='COWQk'></small><noframes id='COWQk'>

                      <bdo id='COWQk'></bdo><ul id='COWQk'></ul>
                        <tbody id='COWQk'></tbody>

                      <tfoot id='COWQk'></tfoot>
                      • <legend id='COWQk'><style id='COWQk'><dir id='COWQk'><q id='COWQk'></q></dir></style></legend>

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