I'm trying to make it so certain text and images on an HTML page cannot be highlighted with the cursor, so it appears as if they're a part of the background.
How Can I Make HTML Elements Unhighlightable? [duplicate]
Asked Answered
Thanks! I searched but didn't find that in the results since it used "unselectable" instead of "unhighlightable". –
Claudiaclaudian
First of all if I would like to know the intention behind this. If this is to prevent the user from copying your text and images then I think its impossible for you to make this happen. Once it is rendered to the client browser area then the whole thing comes under the control of the user.
For images not to be highlighted make them as background.
You can also place a transparent div on top of the area where you don't want the selection to occur. Position the div so that they will appear on top of the element with a higher stacking order. For a greater stacking order you can use the z-index property.
Once it is rendered to the client browser area then the whole thing comes under the control of the user.
Just to additionally clarify... If it's hosted on your website, and there is no authentication necessary to retrieve it, it can be found, and it can be downloaded. Even if you never link to an image anywhere, or use it in a webpage, or put it in an obvious place. If you can get to it over the internet without authentication, anyone can. The only caveat to that would be if you used strong encryption in combination with strong steganography. But even then be careful. –
Depicture © 2022 - 2024 — McMap. All rights reserved.