Home >Web Front-end >CSS Tutorial >What are the css selectors? Which properties can be inherited?

What are the css selectors? Which properties can be inherited?

王林
王林forward
2020-06-19 17:47:283110browse

What are the css selectors? Which properties can be inherited?

CSS selector:

id selector (#myid), class selector (.myclassname), label selector (div, h1, p), relative Neighbor selector (h1 p), child selector (ul > li), descendant selector (li a), wildcard selector (*), attribute selector (a[rel=”external”]), pseudo-class selection Device (a:hover, li:nth-child)

(Recommended tutorial: css quick start)

Inheritable attributes:

font -size, font-family, color

Non-inheritable styles:

border, padding, margin, width, height

Priority (proximity principle):

!important > [ id > class > tag ]!important has higher priority than inline

The above is the detailed content of What are the css selectors? Which properties can be inherited?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:juejin.im. If there is any infringement, please contact admin@php.cn delete