久久久久久久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 選擇器的工具?)
主站蜘蛛池模板: 中文一区 | 天天澡天天狠天天天做 | 伊人爽 | 在线观看 亚洲 | www.4虎影院 国产999精品久久久影片官网 | 91在线精品视频 | 日韩成人在线免费观看 | xxx.在线观看 | 久久久久久亚洲 | 欧美一区二区三区 | 日日夜夜免费精品视频 | 91色在线视频 | 91精品国产自产在线老师啪 | 黄色成人av| 久久久久久久久久久高潮一区二区 | 午夜天堂精品久久久久 | 欧美日韩综合一区 | 国产精品久久久久久久久久三级 | 中午字幕在线观看 | 免费久久网 | 久久久久网站 | 亚洲一卡二卡 | 欧洲高清转码区一二区 | 亚洲91 | 日韩不卡一区二区三区 | 国产午夜影院 | 精品亚洲视频在线 | 色噜噜亚洲男人的天堂 | 精品视频久久久久久 | 国产1区2区3区 | 99久久电影 | 91免费在线看 | 亚洲日本激情 | 精品毛片| 在线欧美视频 | 欧美激情欧美激情在线五月 | 亚洲三级av | 国产一区久久久 | 亚洲精品一区二区在线观看 | 日韩精品在线一区 | 噜噜噜色网|