Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

Making an image unselectable?
(1 viewing) (1) Guest
All your queries regarding HTML will be solved in this forum
  • Page:
  • 1
TOPIC:

Making an image unselectable?

Making an image unselectable? 10 months ago #697

  • palak
  • OFFLINE
  • Senior Boarder
  • Posts: 55
  • Karma: 0
Hello all,
I'm trying to make an image unselectable, when you press CTRL + A (select all) I don't want it to highlight blue or when you drag on the image. I can't find anything about it on google, and I've seen it done before.. anyone know how to do this?

In Firefox and Webkit you can set the CSS properties -moz-user-select and -webkit-user-select to none. This will restrict users from selecting text with the mouse or with CTRL-A, assuming there's no override in the user stylesheet.

Re: Making an image unselectable? 10 months ago #700

  • yoko
Code:

<s-tyle>
body {
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
}
</style>
  • Page:
  • 1
Time to create page: 2.43 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download