chore: Fix ::selection demo style and clean description
This commit is contained in:
20
index.html
20
index.html
@ -144,36 +144,26 @@
|
||||
color: black;
|
||||
}
|
||||
.custom-text-selection::selection {
|
||||
background: red;
|
||||
background: deeppink;
|
||||
color: white;
|
||||
}
|
||||
</code></pre>
|
||||
<h4 data-type="Demo">Demo</h4>
|
||||
<div class="snippet-demo">
|
||||
<p>Global aquamarine selection color</p>
|
||||
<p class="snippet-demo__custom-text-selection">Red selection color.</p>
|
||||
<p class="snippet-demo__custom-text-selection">Select some of this text.</p>
|
||||
</div>
|
||||
<style>
|
||||
::selection {
|
||||
background: aquamarine;
|
||||
color: black;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: aquamarine;
|
||||
color: black;
|
||||
}
|
||||
.snippet-demo__custom-text-selection::selection {
|
||||
background: red;
|
||||
background: deeppink;
|
||||
color: white;
|
||||
}
|
||||
.snippet-demo__custom-text-selection::-moz-selection {
|
||||
background: red;
|
||||
background: deeppink;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
<h4 data-type="Explanation">Explanation</h4>
|
||||
<p><code>::selection</code> and <code>::-moz-selection</code> defines a pseudo selector on an element to style text within it when selected. Note that if you don't combine any other selector your style will be applied at document root level,
|
||||
to any selectable element.</p>
|
||||
<p><code>::selection</code> defines a pseudo selector on an element to style text within it when selected. Note that if you don't combine any other selector your style will be applied at document root level, to any selectable element.</p>
|
||||
<h4 data-type="Browser support">Browser support</h4>
|
||||
<div>
|
||||
<div class="snippet__browser-support">
|
||||
|
||||
Reference in New Issue
Block a user