---
title: "Is there a way to make text unselectable on an HTML page?"  
description: "Is there a way to make text unselectable on an HTML page?"  
author: "Revati S Misra"  
published: 2023-04-27  
updated: 2025-01-09  
canonical: https://www.mindstick.com/forum/158027/is-there-a-way-to-make-text-unselectable-on-an-html-page  
category: "html"  
tags: ["javascript", "html", "html validation"]  
reading_time: 1 minute  

---

# Is there a way to make text unselectable on an HTML page?

Is there a way to make [text unselectable](https://www.mindstick.com/forum/158026/making-text-unselectable) on an [HTML](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) [page](https://www.mindstick.com/articles/13031/why-to-make-a-wikipedia-page)?

## Replies

### Reply by Khushi Singh

Of course, one can disable [text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions) selection on an HTML page by using CSS. Here is a way you can dot it:

## 1. Using CSS

The user-select property stops the user from selecting text. Here's how you can use it:

```css
.unselectable {
 user-select: none;
 -webkit-user-select: none; /* For Chrome, Safari, and Edge */
 -moz-user-select: none; /* For Firefox */
 -ms-user-select: none; /* For Internet Explorer/Edge */
}
```

Apply this class to any element you want to make unselectable:\

```html
<p class="unselectable">This text cannot be selected.</p>
```

## Important Note

Please understand that this does not give perfect content protection. To get to the text part users can use developer tools or open page source. Limit its usage because it could have a negative side depending on the users.


---

Original Source: https://www.mindstick.com/forum/158027/is-there-a-way-to-make-text-unselectable-on-an-html-page

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
