<h1>Prevent text selection with user-select: none;</h1>
<div class="container">
  <article>
    <h2>Can be selected.</h2>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus nesciunt aliquid modi asperiores repellat quaerat quidem numquam soluta ex exercitationem.</p>
  </article>

  <article class="no-select">
    <h2>Can't be slected.</h2>
    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Necessitatibus nesciunt aliquid modi asperiores repellat quaerat quidem numquam soluta ex exercitationem.</p>
  </article>
</div>
body {
  display: grid;
  place-content: center;
  margin: 0;
  min-height: 100vh;
  background-color: hsl(222, 99%, 90%);
  font-family: sans-serif;
  color: hsl(222, 99%, 18%);
  text-align: center;
}

h1 {
  font-size: 1.4rem;
  margin: 0 auto 2rem auto;
}

.container {
  display: flex;
  gap: 2rem;
  margin: 0 auto;
  max-width: 50%;
}

/* Prevent text selections in this article */
article.no-select {
  user-select: none;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.