Annoyed that your users can drag and save your images offsite?
It's actually an intended feature of the browser (and its recommend you keep it enabled for accessability purposes)
Though sometimes there are good reasons for disabling image dragging/saving all-together like when you have purely graphical SVG elements.
Whatever your use case is, here's two simple ways to disable image dragging in HTML:
- Add
draggable="false"
to yourimg
tag (ex:<img draggable="false" src="..."/>
- Add
user-drag: none;
toimg
selector in a CSS file (recommended)
I prefer the second method here because you only have to define 1 CSS selector and 1 property for it to take effect site-wide.
Keep in mind though, you probably don't want to disable image dragging unless you have a compelling reason to!