:read-write
and :read-only
- the details necessary to configure the input form in HTML5. Apparently, it was decided to assemble in one module everything by selectors except pseudo-elements.:not
can only be applied to simple selectors: pseudo-classes, tags, identifiers, classes, and parameter selectors. Pseudo-elements and combinations such as ul li
or ul>li
not supported, and the pseudo-class of negation could not be nested :not(:not(...))
into itself.:matches()
:matches()
very similar to the Mozilla pseudo-class :moz-any()
. Its use is justified if necessary to select a large number of similar selectors. For example, instead of li a:link, li a:hover, li a:visited, li a:focus
just need to specify li a:matches(:link, :hover, :visited)
. Integrated selectors, attachments and use :not
prohibited.:dir
rtl
(from right to left; these are Arabic and Hebrew) and ltr
(from left to right) are listed. Other values are not invalid, but their actions are not specified, which in the future will allow adding new values (probably, they will be from top to bottom and bottom to top).:any-link()
points to links regardless of their attendance. A link that has been once visited (pseudo-class :link
) is not considered to be unvisited; therefore, it was necessary to enter such an element, which can be useful if it is necessary to specify a single style of both states. The item has a mark about the possibility of choosing the best name.:local-link
points to local links. When used simply :local-link
without an expression in parentheses, it will point to the element that points to the current page, that is, to the exactly corresponding URL of the document without an anchor fragment. The number in brackets will indicate the number of matching elements in the URL, for example, the document by reference www.example.com/foo/bar/baz
www.example.com/foo/bar/baz
a:local-link(0)
will point to links to the same domain www.example.com
www.example.com
, a:local-link(1)
- for the domain and the first segment in the URL www.example.com/foo
www.example.com/foo
, a:local-link(2)
- for the domain and the first two segments in the URL www.example.com/foo/bar
www.example.com/foo/bar
.:past
:current
and :future
, associated with time-dependent reproduction or time lane, that is, with means of speech reproduction of HTML-documents. Accordingly :current
will point to the element being processed, which makes it possible to select the fragment being reproduced now :past
will point to elements that have already been processed in the past, and :future
will highlight the elements that will be processed in the future. Y :current
has a version that takes values in brackets.:nth-match
and :nth-last-match
, whose input values are the same as :nth-child
and :nth-last-child
: the same an + b expressions, as well as keywords or a string selector that allows you to select a subset of the results. From the specification to understand the idea is not as easy as an example. Suppose there is a button:nth-match(even of .active)
selector button:nth-match(even of .active)
. Unlike button:nth-child(even)
first defines a subset of elements with the class active
, and only then separates even elements.:column()
:nth-column()
and :nth-last-column
. In HTML, cells are listed in a row and separated by the tr
tag, and the ratio of the cell to the column is implied in the order of enumeration. Therefore, to define the style of a cell based on its belonging to a column, the pseudo-class is entered :column
, which can be applied to one or several selectors. The following draft example will set the yellow color of C
, E
and D
cells:: column (col.selected) {background: yellow; } <table> <col span = "2"> <col class = "selected"> <tr> <td> A <td> B <td> C <tr> <td span = "2"> D <td> E <tr> <td> F <td span = "2"> G </ table>
:nth-column()
and :nth-last-column
take arguments in the same way as existing ones :nth-child
or :nth-last-child
, that is, numeric values, expressions like an+b
, even
values, and odd
. For example :nth-column(odd)
will select all cells belonging to odd columns.ul li.selected
will point to items in the list that have the selected class. But there is no way to set the style of the whole list based on the properties of the elements nested in it.selected
. The object selector will easily allow you to do this:$ul li.selected {
background: white;
}
Source: https://habr.com/ru/post/131788/
All Articles