久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

:not() 否定是否接受后代選擇器?

Does :not() negation accept descendant selectors?(:not() 否定是否接受后代選擇器?)
本文介紹了:not() 否定是否接受后代選擇器?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我一直在使用 :not() 偽類來設置樣式,而無需使用第二個不必要的聲明來撤消第一個聲明來覆蓋它,但現在我遇到了一個奇怪的行為,Safari 接受 :not() 中的后代選擇器,但 Chrome 不接受.

I've been using the :not() pseudo-class to style things without the need to override it with a second unnecessary declaration to undo the first one, but now I came across a weird behaviour where Safari accepts descendant selectors within the :not(), but Chrome doesn't.

我使用了類似 a:not(.blue a).

我搜索了答案,但我仍然不完全理解原因.規范真的允許后代選擇器嗎?

I searched for answers, but I still don't fully understand the reason.
Are descendant selectors really allowed by the spec?

這是一個演示:

a:not(.blue a) {
  color: red;
}

<div><a>this one should be in red</a></div>
<div class="blue"><a>this one shouldn't</a></div>

http://codepen.io/oscarmarcelo/pen/YqboQJ?editors=1100

推薦答案

在 Selectors Level3,答案是否定的.:not() 表示法只接受 簡單的選擇器.

In Selectors Level 3, the answer would be NO. The :not() notation accepts only simple selectors.

6.6.7.否定偽類

否定偽類:not(X)是一個函數式記號簡單選擇器(不包括否定偽類本身)作為爭論.它表示一個元素,它沒有被它的論據.

The negation pseudo-class, :not(X), is a functional notation taking a simple selector (excluding the negation pseudo-class itself) as an argument. It represents an element that is not represented by its argument.

什么是簡單選擇器?

來自選擇器語法:

簡單選擇器可以是類型選擇器、通用選擇器、屬性選擇器、類選擇器、ID 選擇器或偽類.

A simple selector is either a type selector, universal selector, attribute selector, class selector, ID selector, or pseudo-class.

與后代選擇器無關.

但是,在 選擇器級別4,:not() 接受復雜選擇器,其中包括后代組合器.瀏覽器對該規范的支持仍然很弱.

HOWEVER, in Selectors Level 4, :not() accepts complex selectors, which would include descendant combinators. Browser support is still quite weak for this specification.

這篇關于:not() 否定是否接受后代選擇器?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Style every third element?(每隔三個元素設置樣式?)
Why shouldn#39;t I use ID selectors in CSS?(為什么我不應該在 CSS 中使用 ID 選擇器?)
What does img[class*=quot;alignquot;] mean in CSS?(CSS 中的 img[class*=“align] 是什么意思?)
CSS: Last element on line(CSS:最后一個元素)
How do I select every other div class element using just CSS (no js)(如何僅使用 CSS(無 js)選擇所有其他 div 類元素)
Tool for checking unused CSS selectors?(檢查未使用的 CSS 選擇器的工具?)
主站蜘蛛池模板: 国产在线网址 | 成人一区二区三区在线观看 | 精品国产乱码久久久久久丨区2区 | 日本久久网 | 日日日干干干 | 欧美a∨ | 日韩淫片免费看 | 亚洲综合字幕 | 成人av电影天堂 | 欧美一区二区 | 成人精品一区亚洲午夜久久久 | 视频一区 国产精品 | 欧美日韩大片 | 亚洲视频一区二区 | 欧美一区二区三区在线观看 | 欧美日韩一区二区三区不卡视频 | 欧美日韩一区二区三区四区五区 | 国产欧美一区二区三区在线看蜜臀 | 亚洲视频在线看 | 国产精品久久毛片av大全日韩 | 亚洲丝袜天堂 | 成人免费淫片aa视频免费 | 在线观看一区 | 国产在线视频在线观看 | 久草在线 | 亚洲国产精品第一区二区 | 天堂色| 91久久北条麻妃一区二区三区 | 一区二区视频 | 欧美精品久久久 | 久久精品亚洲成在人线av网址 | www.亚洲免费 | 人人擦人人 | 国产日韩一区二区 | 国产色在线 | 国产精品一级在线观看 | 女人夜夜春 | 亚洲成人精| 91精品中文字幕一区二区三区 | 美女视频黄的免费 | 日韩国产精品一区二区三区 |