cross browser - How to disable text selection highlighting using CSS? -


For the anchors that act as buttons (for example, question , Tag , user , etc. & nbsp; overflow page at the top of the heap) or tab, is there a CSS standard way to disable the highlighting effect if the user selects abrupt text is?

I realize that this can be done with Javascript, and a small googling has received the Mozilla-only -moz-user-select option.

Is there a standard-compliance method to complete it with CSS, and if not, what is the "best practice" approach?

according to January, 2017:

Accordingly, select user currently in all browsers the Internet & nbsp; Excluding Explorer 9 and previous versions is supported (but unfortunately still needs a vendor prefix.)


All correct CSS variations are:

  .noselect {-webkit- touch-callout: none; / * IOS Safari * / -webkit-user-select: none; / * Safari * / -khtml - Select User: None; / * Conquer HTML * / -moz-user-select: none; / * Choose Firefox * / -MMS-User: None; / * Internet Explorer / Age * / User-select: None; / * Non-prefix version, which is currently supported by Chrome and Opera * /}  
  & lt ; P & gt; Selectable text & lt; / P & gt; & Lt; P class = "noselect" & gt; Non-selective text & lt; / P & gt; Note  
Part). It is not guaranteed to work everywhere, and implementation can vary between browsers, and in the future browsers can leave support for it.


More information can be found.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -