css二级联动
Cascade is a fundamental concept of CSS. After all, it’s in the name itself, the first C of CSS - Cascading Style Sheets - it must be an important thing.
级联是CSS的基本概念。 毕竟,它的名字本身就是CSS的第一个C语言-级联样式表-它必须是一件重要的事情。
What does it mean?
这是什么意思?
Cascade is the process, or algorithm, that determines the properties applied to each element on the page.
级联是确定应用于页面上每个元素的属性的过程或算法 。
Trying to converge from a list of CSS rules that are defined in various places.
尝试从各地定义CSS规则列表中收敛。
It does so taking in consideration:
这样做时考虑到:
- importance 重要性
- inheritance 遗产
- order in the file 在文件中排序
It also takes care of resolving conflicts.
它还负责解决冲突。
Two or more competing CSS rules for the same property applied to the same element need to be elaborated according to the CSS spec, to determine which one needs to be applied.
需要根据CSS规范为适用于同一元素的相同属性制定两个或两个以上竞争CSS规则,以确定需要应用哪个。
Even if you just have one CSS file loaded by your page, there is other CSS that is going to be part of the process. We have the browser (user agent) CSS. Browsers come with a default set of rules, all different between browsers.
即使您的页面仅加载了一个CSS文件,其他CSS也将成为该过程的一部分。 我们有浏览器(用户代理)CSS。 浏览器带有一组默认规则,所有浏览器之间都有所不同。
Then your CSS come into play.
然后您CSS开始发挥作用。
Then the browser applies any user stylesheet, which might also be applied by browser extensions.
然后,浏览器将应用任何用户样式表,浏览器扩展也可能会应用该样式表。
All those rules come into play while rendering the page.
所有这些规则在呈现页面时都会起作用。
css二级联动