CssPseudoElement Class
A pseudo-element of an element (https://drafts.csswg.org/css-pseudo-4/#CSSPseudoElement-interface), returned by Element.Pseudo: a tree-abiding pseudo-element that is not element-backed (::before, ::after, ::marker, ::backdrop, the scroll navigation controls, the view transition pseudo-elements...). The object exists whether or not the pseudo-element is generated, and the same object represents the same pseudo-element of the same originating element.
public sealed class CssPseudoElementRemarks
The sub-pseudo-elements are the ::marker of ::before and ::after, and the view transition pseudo-elements, whose parent is their parent in the view transition tree without nested group (::view-transition > ::view-transition-group() > ::view-transition-image-pair() > ::view-transition-old() and ::view-transition-new()).
See also
Properties
| Name | Description |
|---|---|
| Element | Gets the ultimate originating element of the pseudo-element. |
| Parent | Gets the originating element of the pseudo-element, or its originating pseudo-element for a sub-pseudo-element. |
| SelectorText | Gets the normalized selector of the pseudo-element, with its argument (e.g. ::scroll-button(inline-end)). |
| Type | Gets the type of the pseudo-element: its name with the colons and without its argument (e.g. ::scroll-button). |
Element
CssPseudoElement.csGets the ultimate originating element of the pseudo-element.
public Element Element { get; }Parent
CssPseudoElement.csGets the originating element of the pseudo-element, or its originating pseudo-element for a sub-pseudo-element.
public ElementOrCssPseudoElement Parent { get; }SelectorText
CssPseudoElement.csGets the normalized selector of the pseudo-element, with its argument (e.g. ::scroll-button(inline-end)).
public string SelectorText { get; }Property value
See also
Gets the type of the pseudo-element: its name with the colons and without its argument (e.g. ::scroll-button).
public string Type { get; }Methods
| Name | Description |
|---|---|
| ConvertPointFromNode(DomPointInit, GeometryNode, ConvertCoordinateOptions?) | Converts a point from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertpointfromnode). |
| ConvertQuadFromNode(DomQuadInit, GeometryNode, ConvertCoordinateOptions?) | Converts a quad from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertquadfromnode). |
| ConvertRectFromNode(DomRectReadOnly, GeometryNode, ConvertCoordinateOptions?) | Converts a rectangle from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertrectfromnode). |
| GetBoxQuads(BoxQuadOptions?) | Returns the quads of the boxes of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-getboxquads): one per box fragment, empty when the pseudo-element does not generate a box. |
| Pseudo(string) | Returns the sub-pseudo-element of the pseudo-element designated by a pseudo-element selector, or null when it cannot exist (https://drafts.csswg.org/css-pseudo-4/#dom-csspseudoelement-pseudo): the ::marker of a ::before or ::after, or the child of a view transition pseudo-element of the same name. |
| ToString() | Returns a string that represents the current object. |
ConvertPointFromNode(DomPointInit, GeometryNode, ConvertCoordinateOptions?)
CssPseudoElement.csConverts a point from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertpointfromnode).
public DomPoint ConvertPointFromNode(DomPointInit point, GeometryNode from, ConvertCoordinateOptions? options = null)ConvertQuadFromNode(DomQuadInit, GeometryNode, ConvertCoordinateOptions?)
CssPseudoElement.csConverts a quad from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertquadfromnode).
public DomQuad ConvertQuadFromNode(DomQuadInit quad, GeometryNode from, ConvertCoordinateOptions? options = null)ConvertRectFromNode(DomRectReadOnly, GeometryNode, ConvertCoordinateOptions?)
CssPseudoElement.csConverts a rectangle from the coordinates of a node to the coordinates of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertrectfromnode).
public DomQuad ConvertRectFromNode(DomRectReadOnly rect, GeometryNode from, ConvertCoordinateOptions? options = null)GetBoxQuads(BoxQuadOptions?)
CssPseudoElement.csReturns the quads of the boxes of the pseudo-element (https://drafts.csswg.org/cssom-view/#dom-geometryutils-getboxquads): one per box fragment, empty when the pseudo-element does not generate a box.
public IReadOnlyList<DomQuad> GetBoxQuads(BoxQuadOptions? options = null)Pseudo(string)
CssPseudoElement.csReturns the sub-pseudo-element of the pseudo-element designated by a pseudo-element selector, or null when it cannot exist (https://drafts.csswg.org/css-pseudo-4/#dom-csspseudoelement-pseudo): the ::marker of a ::before or ::after, or the child of a view transition pseudo-element of the same name.
public CssPseudoElement? Pseudo(string type)