pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

選擇器部分和部分的正確術(shù)語和單詞

Correct terms and words for sections and parts of selectors(選擇器部分和部分的正確術(shù)語和單詞)
本文介紹了選擇器部分和部分的正確術(shù)語和單詞的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

用逗號(hào)分隔的 CSS 選擇器部分的正確術(shù)語是什么?

What is the correct term for the sections of CSS selectors that are separated by commas?

    body.foo .login , body.bar .login { ... }
/*                  |
           Part 1   |  Part 2         */

在這些部分中,由組合符分隔的部分(空格、+> 等)的術(shù)語是什么?

Within those sections, what is the term for the parts separated by combinators (spaces, +, >, etc)?

    body.foo .login , ... { ... }
/*          |
   Part 1   |   Part 2    */

推薦答案

用逗號(hào)分隔的 CSS 選擇器部分的正確術(shù)語是什么?

What is the correct term for the sections of CSS selectors that are separated by commas?

這些被稱為復(fù)雜選擇器.整個(gè)以逗號(hào)分隔的列表稱為選擇器列表.

在這些部分中,由組合符分隔的部分(空格、+> 等)的術(shù)語是什么?

Within those sections, what is the term for the parts separated by combinators (spaces, +, >, etc)?

這些被稱為 復(fù)合選擇器.

These are known as compound selectors.

因此,選擇器列表由一個(gè)或多個(gè)用逗號(hào)分隔的復(fù)雜選擇器組成,每個(gè)復(fù)雜選擇器由兩個(gè)主要部分組成:復(fù)合選擇器和組合器.它還可以選擇包含偽元素.

So, a selector-list is made up of one or more complex selectors separated by commas, and each complex selector is made up of two main parts: compound selectors, and combinators. It can also optionally contain pseudo-elements.

復(fù)合選擇器曾經(jīng)有一個(gè)相當(dāng)復(fù)雜的名稱簡單選擇器序列".更糟糕的是,復(fù)雜的選擇器只是被稱為選擇器".不用說,我建議使用新術(shù)語,因?yàn)榕c它們的前輩相比,它們更直接、更簡潔且完全不含糊.

Compound selectors used to have the rather convoluted name "sequence of simple selectors". Worse still, complex selectors were just called "selectors". Needless to say, I recommend using the new terms as they are much more straightforward, much less cumbersome and completely unambiguous compared to their predecessors.

既然我在這里,這里是其余的定義......

And since I'm here, here are the rest of the definitions...

  • 簡單的選擇器是選擇器的基本組成部分.它是以下任何一種:

  • A simple selector is one fundamental component of selectors. It is any one of the following:

  • 通用選擇器 (*),可選地帶有命名空間
  • 類型選擇器(adivspanulli等),可選地使用命名空間
  • 屬性選擇器([att][att=val] 等)、可選的命名空間
  • 類選擇器(.class)
  • ID 選擇器 (#id)
  • 偽類(:偽類)
  • Universal selector (*), optionally with a namespace
  • Type selector (a, div, span, ul, li, etc), optionally with a namespace
  • Attribute selector ([att], [att=val], etc), optionally with a namespace
  • Class selector (.class)
  • ID selector (#id)
  • Pseudo-class (:pseudo-class)

如上所述,復(fù)合選擇器(以前稱為簡單選擇器序列")是不由組合器分隔的簡單選擇器鏈:

As answered above, a compound selector (formerly a "sequence of simple selectors") is a chain of simple selectors not separated by a combinator:

a:not([rel="external"]):hover

  • 組合器是選擇器的另一個(gè)基本組成部分.它是分隔兩個(gè)復(fù)合選擇器的符號(hào)或標(biāo)記,在其位置建立由兩個(gè)復(fù)合選擇器表示的兩個(gè)元素之間的關(guān)系.目前有四種組合器在使用:

  • A combinator is another fundamental component of selectors. It is a symbol or token that separates two compound selectors, establishing in its place a relationship between the two elements represented by the two compound selectors. There are currently four combinators in use today:

    • 后代組合子:

    • Descendant combinator:

    article p
    

  • 子組合子:

  • Child combinator:

    /* 
     * The extra spaces in between are whitespace,
     * and are therefore insignificant.
     */
    ul > li
    

  • 相鄰兄弟組合子:

  • Adjacent sibling combinator:

    header + section
    

  • 通用兄弟組合子:

  • General sibling combinator:

    h2 ~ p
    

  • 更多的組合子可能會(huì)在以后的規(guī)范中引入.

    More combinators may be introduced in later specifications.

    復(fù)合選擇器(以前只是選擇器")是由組合器鏈接的復(fù)合選擇器組成的完整字符串:

    And a complex selector (formerly just "selector") is a complete string made up of compound selectors linked by combinators:

    nav[role="main"] > ul:first-child > li
    

  • 復(fù)合選擇器的主題是它的最后一個(gè)或唯一的復(fù)合選擇器,表示將被匹配或設(shè)置樣式的元素.在上面的例子中,選擇器的主題是 li.

  • The subject of a complex selector is its last, or only, compound selector, representing the element that will be matched or styled. In the above example, the subject of the selector is li.

    術(shù)語 selector 已被概括,因此為了簡單明了,它現(xiàn)在可以指代以下任何一個(gè),以及它指的是哪個(gè)to 在任何給定時(shí)刻都應(yīng)該從上下文中收集:

    The term selector has been generalized, so it may now refer to any of the following for the purposes of simplicity and brevity, and which one it's referring to at any given moment should be gleaned from context:

    • 簡單的選擇器
    • 復(fù)合選擇器
    • 復(fù)雜選擇器
    • 選擇器列表(例如樣式規(guī)則的選擇器"組件)

    一些個(gè)人筆記:

    • 術(shù)語鍵選擇器"是瀏覽器供應(yīng)商創(chuàng)造的,用于選擇器實(shí)現(xiàn),并不是一個(gè)官方術(shù)語.然而,它通常用于表示選擇器的主題",因?yàn)閷?shí)現(xiàn)碰巧使用選擇器的主題作為確定匹配的關(guān)鍵.

    • The term "key selector" was coined by browser vendors for use with selector implementations, and is not an official term. It is often used to mean "subject of the selector" however, because implementations happen to use the subject of the selector as the key for the purposes of determining matches.

    pseudo-selector"這個(gè)詞是作者為了混合偽類和偽元素而創(chuàng)造的,它不是一個(gè)官方的,也不是真正有意義的術(shù)語.盡管您可以在一些早期的 W3C CSS2/3 草案中找到它,但這可能是一個(gè)錯(cuò)誤.請不要使用這個(gè)詞,因?yàn)樗槐匾貏?chuàng)建試圖將兩個(gè)完全不同的概念歸為一個(gè)總稱來混淆.

    The term "pseudo-selector" was coined by authors to mix pseudo-classes and pseudo-elements, and is not an official, or indeed meaningful, term. Although you can find it in some early-stage W3C CSS2/3 drafts, that was probably a mistake. Please don't use this term, as it needlessly creates confusion by attempting to group two completely different concepts into a single umbrella term.

    偽元素(::pseudo-element)不是簡單的選擇器,因此不能出現(xiàn)在只能匹配實(shí)際元素的地方.但是,出于 CSS 解析的目的,它們?nèi)员灰暈檫x擇器,并且如上所述,目前可以出現(xiàn)在列表中任何復(fù)雜選擇器的末尾(即,在每個(gè)復(fù)雜選擇器的最后一個(gè)或唯一一個(gè)復(fù)合選擇器的末尾).

    Pseudo-elements (::pseudo-element) are not simple selectors, and therefore cannot appear in places where only actual elements may be matched. However, they are still considered selectors for the purposes of CSS parsing, and as stated above currently can appear at the end of any complex selector in a list (i.e. at the end of the last, or only, compound selector of each complex selector).

    在 CSS 中,一個(gè)典型的樣式規(guī)則(以前稱為規(guī)則集")由一個(gè)選擇器和一個(gè)聲明塊組成.

    In CSS, a typical style rule (formerly "ruleset") consists of a selector and a declaration block.

    命名空間前綴本身不是選擇器,但它們可以應(yīng)用于類型選擇器、通用選擇器和屬性選擇器,以匹配文檔中已(或未)命名空間的組件.

    Namespace prefixes are not selectors in their own right, but they may be applied to type selectors, universal selectors and attribute selectors to match components in a document that are (or are not) namespaced.

    選擇器的特異性目前僅指一個(gè)復(fù)雜的選擇器.匹配規(guī)則時(shí),列表中與給定元素匹配的任何復(fù)雜選擇器都將被考慮用于特異性計(jì)算.如果多個(gè)復(fù)雜選擇器與一個(gè)元素匹配,則將使用最具體的選擇器進(jìn)行計(jì)算.

    The specificity of a selector currently only refers to that of a single complex selector. When matching rules, any of the complex selectors in a list that match a given element will be considered for specificity calculations. If more than one complex selector matches an element, the most specific one will be used for calculations.

    對于某些 4 級(jí)選擇器,特異性將是一個(gè)更復(fù)雜的問題,例如 :is() 和增強(qiáng)的 :not(),以及 of增強(qiáng)的 :nth-child() 偽中的 S 表示法.

    Specificity will be a more complicated issue with some level 4 selectors, such as :is() and the enhanced :not(), and the of S notation in the enhanced :nth-child() pseudo.

    這篇關(guān)于選擇器部分和部分的正確術(shù)語和單詞的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

    【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!
  • 相關(guān)文檔推薦

    Style every third element?(每隔三個(gè)元素設(shè)置樣式?)
    Why shouldn#39;t I use ID selectors in CSS?(為什么我不應(yīng)該在 CSS 中使用 ID 選擇器?)
    What does img[class*=quot;alignquot;] mean in CSS?(CSS 中的 img[class*=“align] 是什么意思?)
    CSS: Last element on line(CSS:最后一個(gè)元素)
    How do I select every other div class element using just CSS (no js)(如何僅使用 CSS(無 js)選擇所有其他 div 類元素)
    Tool for checking unused CSS selectors?(檢查未使用的 CSS 選擇器的工具?)
    主站蜘蛛池模板: 质构仪_鱼糜弹性仪-上海腾拔仪器科技有限公司| 金属检测机_金属分离器_检针验针机_食品药品金属检探测仪器-广东善安科技 | 电车线(用于供电给电车的输电线路)-百科 | 不锈钢钢格栅板_热浸锌钢格板_镀锌钢格栅板_钢格栅盖板-格美瑞 | 珠海冷却塔降噪维修_冷却塔改造报价_凉水塔风机维修厂家- 广东康明节能空调有限公司 | 卷筒电缆-拖链电缆-特种柔性扁平电缆定制厂家「上海缆胜」 | 体检车_移动CT车_CT检查车_CT车_深圳市艾克瑞电气有限公司移动CT体检车厂家-深圳市艾克瑞电气有限公司 | 广东佛电电器有限公司|防雷开关|故障电弧断路器|智能量测断路器 广东西屋电气有限公司-广东西屋电气有限公司 | 真空包装机-诸城市坤泰食品机械有限公司 | 铝合金风口-玻璃钢轴流风机-玻璃钢屋顶风机-德州东润空调设备有限公司 | DNA亲子鉴定_DNA基因检测中心官方预约平台-严选好基因网 | 二维运动混料机,加热型混料机,干粉混料机-南京腾阳干燥设备厂 | 聚合甘油__盐城市飞龙油脂有限公司 | 环氧乙烷灭菌器_压力蒸汽灭菌器_低温等离子过氧化氢灭菌器 _低温蒸汽甲醛灭菌器_清洗工作站_医用干燥柜_灭菌耗材-环氧乙烷灭菌器_脉动真空压力蒸汽灭菌器_低温等离子灭菌设备_河南省三强医疗器械有限责任公司 | 热熔胶网膜|pes热熔网膜价格|eva热熔胶膜|热熔胶膜|tpu热熔胶膜厂家-苏州惠洋胶粘制品有限公司 | 仿真茅草_人造茅草瓦价格_仿真茅草厂家_仿真茅草供应-深圳市科佰工贸有限公司 | 全自动端子机|刺破式端子压接机|全自动双头沾锡机|全自动插胶壳端子机-东莞市傅氏兄弟机械设备有限公司 | 破碎机锤头_合金耐磨锤头_郑州宇耐机械工程技术有限公司 | 酸度计_PH计_特斯拉计-西安云仪 纯水电导率测定仪-万用气体检测仪-低钠测定仪-米沃奇科技(北京)有限公司www.milwaukeeinst.cn | 电池挤压试验机-自行车喷淋-车辆碾压试验装置-深圳德迈盛测控设备有限公司 | 天津力值检测-天津管道检测-天津天诚工程检测技术有限公司 | 座椅式升降机_无障碍升降平台_残疾人升降平台-南京明顺机械设备有限公司 | 淘剧影院_海量最新电视剧,免费高清电影随心观看 | 私人别墅家庭影院系统_家庭影院音响_家庭影院装修设计公司-邦牛影音 | 净化车间装修_合肥厂房无尘室设计_合肥工厂洁净工程装修公司-安徽盛世和居装饰 | 建大仁科-温湿度变送器|温湿度传感器|温湿度记录仪_厂家_价格-山东仁科 | 泥浆在线密度计厂家-防爆数字压力表-膜盒-远传压力表厂家-江苏大亚自控设备有限公司 | 一体化污水处理设备_生活污水处理设备_全自动加药装置厂家-明基环保 | 亮化工程,亮化设计,城市亮化工程,亮化资质合作,长沙亮化照明,杰奥思【官网】 | elisa试剂盒价格-酶联免疫试剂盒-猪elisa试剂盒-上海恒远生物科技有限公司 | 奇酷教育-Python培训|UI培训|WEB大前端培训|Unity3D培训|HTML5培训|人工智能培训|JAVA开发的教育品牌 | 贴板式电磁阀-不锈钢-气动上展式放料阀-上海弗雷西阀门有限公司 工业机械三维动画制作 环保设备原理三维演示动画 自动化装配产线三维动画制作公司-南京燃动数字 | 浴室柜-浴室镜厂家-YINAISI · 意大利设计师品牌 | 咿耐斯 |-浙江台州市丰源卫浴有限公司 | 成人纸尿裤,成人尿不湿,成人护理垫-山东康舜日用品有限公司 | 全自动实验室洗瓶机,移液管|培养皿|进样瓶清洗机,清洗剂-广州摩特伟希尔机械设备有限责任公司 | 志高装潢官网-苏州老房旧房装修改造-二手房装修翻新 | 执业药师报名时间,报考条件,考试时间-首页入口 | 苏州柯瑞德货架-仓库自动化改造解决方案 | 螺旋绞龙叶片,螺旋输送机厂家,山东螺旋输送机-淄博长江机械制造有限公司 | 吊篮式|移动式冷热冲击试验箱-二槽冷热冲击试验箱-广东科宝 | 一体化污水处理设备,一体化污水设备厂家-宜兴市福源水处理设备有限公司 |