CSS Selector
来源:互联网 发布:上海百胜软件 编辑:程序博客网 时间:2024/06/14 00:37
Css Diner
Select what you want.
A + B
This selects all B elements that directly follow A.
Elements that follow one another are called siblings.
They’re on the same level, or depth.
In the HTML markup for this level, elements that have the same indentation are siblings.
Examples
p + .intro
selects every element with class=”intro” that directly follows a pdiv + a
selects every a element that directly follows aA ~ B
You can select all siblings of an element that follow it.
This is like the Adjacent Selector (A + B) except it gets all of the following elements instead of one.
Examples
A ~ B
selects all B that follow a AA > B
You can select elements that are direct children of other elements.
A child element is any element that is nested directly in another element.
Elements that are nested deeper than that are called descendant elements.
Examples
A > B
selects all B that are a direct children A:nth-of-type[An+B]
The nth-of-type formula selects every nth element, starting the count at a specific instance of that element.
Examples
span:nth-of-type(6n+2)
selects every 6th instance of a span, starting from (and including) the second instance.:empty
Selects elements that don’t have any other elements inside of them.
Examples
div:empty
selects all empty div elements.:not(X)
You can use this to select all elements that do not match selector “X”.
Examples
:not(#fancy)
selects all elements that do not have id=”fancy”.div:not(:first-child)
selects every div that is not a first child.:not(.big, .medium)
selects all elements that do not have class=”big” or class=”medium”.[attribute*=”value”]
A useful selector if you can identify a common pattern in things like class, href or src attributes.
Examples
img[src*="/thumbnails/"]
selects all image elements that show images from the"thumbnails"
folder.[class*="heading"]
selects all elements with “heading” in their class, likeclass="main-heading"
andclass="sub-heading"
.
- css selector
- CSS Selector
- CSS Selector
- css selector
- css selector
- CSS Selector
- CSS Syntax (Selector)
- 学习笔记:css selector
- css selector简介
- css中简单selector
- Selenium - CSS Selector
- css+js模仿selector
- Selenium - CSS Selector
- Selenium - CSS Selector
- Selenium - CSS Selector
- CSS Selector(berserkjs用到)
- Selenium - CSS Selector
- CSS child selector
- [LeetCode P72] 编辑距离Levenshtein Distance算法[经典动态规划]
- ProtoBuf.js 使用技巧
- BandwagonHost搬瓦工购买、安装和速度慢、加速指南
- Go实战--golang使用ssl连接MongoDB(mgo)
- kibana双实例部署
- CSS Selector
- Spring中ApplicationContext对事件传递
- Selenium修改元素的z-index属性
- bootstrap学习记录
- iOS Swift开发总结-- 【持续更新】
- blender学习计划&blender手册翻译--模型篇
- nodejs package.json详解
- python3.6版本生成的python脚本如何打包为可独立执行的exe程序
- 小程序文档整理之 -- 模板