How to protect content in webpage? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to protect content in webpage?

If someone long tap or double click in text line in webpage, then text line has selected for copy, how to protect text and image being copy.

9th May 2018, 8:55 PM
Mr. Jay Koranga
Mr.  Jay Koranga - avatar
4 Answers
+ 4
They can still be copied by removing it with developer tools. There's no way to protect your content.
9th May 2018, 10:57 PM
Toni Isotalo
Toni Isotalo - avatar
+ 3
That's easy... Just add user-select: none; to the CSS of your main div
9th May 2018, 10:09 PM
cyk
cyk - avatar
+ 1
thanks
9th May 2018, 10:49 PM
Mr. Jay Koranga
Mr.  Jay Koranga - avatar
+ 1
You can use some front-end CSS and JS to protect from the average user, but anybody will minimal knowledge of the developer console can still get around this. To protect images the best thing to do is copyright them.
9th May 2018, 11:50 PM
Ben Allen (Njinx)
Ben Allen (Njinx) - avatar