CSS: Prevent Right Click
Prevent Right Click
to prevent right click, use this JavaScript
document.addEventListener ('contextmenu', (x => x.preventDefault ()) , false);
user-select Property
Prevent text selection.
Note, this does not work for right-click menu.
body {user-select: none;}
Note: does not work in Safari nor Firefox as of 2019-02-26
Possible values:
user-select:auto- inital value.
user-select:none- not selectable.
user-select:text- selectable.
user-select:contain- (not much used)
user-select:all- (not much used)
CSS, misc, advanced
- CSS: @media query (responsive design)
- CSS: Variable (Custom Property)
- CSS: calc
- CSS: Reset, Default Values
- CSS: global keywords (property values)
- CSS: nesting selector (ampersand &)
- CSS: Computed Style
- CSS: Browser Default Style Sheet (2025-12)