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

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

        <tfoot id='nTK3i'></tfoot>

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

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

        选择除悬停一个 CSS 之外的所有链接

        Selecting all links except hovered one CSS only(选择除悬停一个 CSS 之外的所有链接)
          <tbody id='NunQF'></tbody>

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

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

              1. <tfoot id='NunQF'></tfoot>

                • <bdo id='NunQF'></bdo><ul id='NunQF'></ul>
                  本文介绍了选择除悬停一个 CSS 之外的所有链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I'm trying to make a CSS selector that matches all links except the hovered one. Naturally I though of using the ~ operator to catch around elements:

                  a:hover ~a
                  

                  This works fine but it only matches elements after the hovered one, and I would like to get the ones before as well. So I though of using this:

                  a:hover ~a,  a ~a:hover
                  

                  But no success.


                  Here is a JSFiddle that shows what I am talking about.
                  Of course I know I could do it easily with jQuery but I like to exploit CSS as much as possible when I think javascript can be avoided.

                  解决方案

                  You cant do what you are explicitly after, without using JavaScript due to the way CSS selectors work based on DOM hierarchy and their limited potential for traversal.

                  However, given what I imagine you are trying to achieve, why not apply the hover to the parent element and exclude the currently hovered a?

                  Demo Fiddle

                  (and an alternative)

                  div:hover a:not(:hover){
                      color:red;
                  }
                  

                  这篇关于选择除悬停一个 CSS 之外的所有链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 模块中)
                  <tfoot id='UvIrL'></tfoot>
                  <i id='UvIrL'><tr id='UvIrL'><dt id='UvIrL'><q id='UvIrL'><span id='UvIrL'><b id='UvIrL'><form id='UvIrL'><ins id='UvIrL'></ins><ul id='UvIrL'></ul><sub id='UvIrL'></sub></form><legend id='UvIrL'></legend><bdo id='UvIrL'><pre id='UvIrL'><center id='UvIrL'></center></pre></bdo></b><th id='UvIrL'></th></span></q></dt></tr></i><div id='UvIrL'><tfoot id='UvIrL'></tfoot><dl id='UvIrL'><fieldset id='UvIrL'></fieldset></dl></div>

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

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

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

                              <tbody id='UvIrL'></tbody>