Wednesday, January 15, 2025
HomeProgrammingHow to make HTML Text unselectable? - css

How to make HTML Text unselectable? [duplicate] – css

To make text unselectable in HTML using CSS, you can apply the user-select property with the value none. Here’s how you can do it:

cssCopy code

.unselectable {

user-select: none;}

Then, apply the class to the element whose text you want to make unselectable:

See also  How to show tables in PostgreSQL? - database

html

Copy code

<p class=”unselectable”>This text cannot be selected.</p>

This will prevent users from selecting the text within that element.

 

 

 

 

 

 

 

 

 

 

 

 

RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x