Make the text inside .my_paragraph have white color and black background when it is selected.
Pseudo-elements
Selected text
Report a typo
Write HTML and CSS code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Selected text</title>
</head>
<body>
<div class="container">
<div class="container_inside">
<h1>Pseudo-elements</h1>
<p class="my_paragraph">The Almighty CSS allows you to not only work with
elements declared in your HTML code but to also customize those parts of
the page you can not address using simple selectors. This might be the
customization of the first line of the paragraph, the first letter of the
paragraph, or even the part of the text user has just selected.</p>
<p>Here is the list of the most-used pseudo-elements:</p>
<ul class="my_list">
<li>::first-line</li>
<li>::first-letter</li>
<li>::placeholder</li>
<li>::marker</li>
<li>::before</li>
<li>::after</li>
<li>::selection</li>
</ul>
</div>
</div>
</body>
</html>
Completed 0 of 1
Good job!
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.