Learn how to override the default text selection color with CSS. While using this site, you agree to have read and accepted our Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. Voneinander unabhängige Selektoren, denen dieselben Eigenschaften zugewiesen werden, können in einer mit Kommata getrennten Selektor-Liste notiert werden. W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tag-Namen wie p, div oder body suchen nach allen Elementen eines Typs und bringen CSS-Stile in HTML-Elemente. CSS Kontext-Selektoren Ein Nachfahren-Selektor oder Nachbar-Selektor wählt Elemente anhand ihrer Position zu anderen Elementen aus – aus dem Kontext oder der Kombination von Elementen in der HTML-Struktur. Ein CSS Selektor identifiziert HTML-Elemente durch Suchmuster, die miteinander kombiniert werden können, um aus einfachen Selektoren komplexe Filter zu erzeugen.

Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. Use our CSS Selector Tester to demonstrate the different selectors. Text Selection Color. The ::selection CSS pseudo-element applies styles to the part of a document that has been highlighted by the user (such as clicking and dragging the mouse across text). This can help you improve usability in certain situations and add a little bit of visual flair. Learn how to override the default text selection color with CSS.If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: Only certain CSS properties can be used with ::selection: color; background-color; cursor; caret-color; outline and its longhands; text-decoration and its associated properties; text … Examples might be simplified to improve reading and basic understanding. In CSS, selectors are patterns used to select the element(s) you want to style.If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail: Die einfachsten CSS-Selektoren sind Typ- oder Element-Selektoren. Custom text selection color. How To Change Text Selection Color. In CSS, selectors are patterns used to select the element(s) you want to style. While using this site, you agree to have read and accepted our CSS Selectors. Kontext-Selektoren sind also abhängig von der Struktur, in der sie auftreten: von ihren Nachbarn, Vorfahren und Nachfahren. ::selection { background-color: cyan; } Allowable properties. Select the following text: Default text selection color. Using CSS to Control Text Selection April 26, 2020 CSS lets you control how text selection behaves and appears on your pages. W3Schools is optimized for learning, testing, and training. Als Selektoren bezeichnet man die Teile einer CSS-Regel, die vor dem Abschnitt aus geschweiften Klammern stehen.