紀錄工作經驗、相關知識,解決技術相關問題。

CSS, HTML, 工作雜談

css 禁止選取 – 去除 html 點擊選取出現藍色背景

網頁操作,尤其手機移動端,操作上常出現點選後,選取到內容,使得內文背景反藍色,要禁止選取HTML內文,移除請加上下面代碼

{
  -moz-user-select: none; /* Firefox */
  -webkit-user-select: none;  /* Chrome , Safari*/
  -ms-user-select: none;  /* IE10 */
  -khtml-user-select: none;  /* 古早瀏覽器 */
  user-select: none; 
}

2 留言

  1. Do you mind if I quote a couple of your articles as long asI provide credit and sources back to your website?My blog site is in the very same niche as yours and my users would certainly benefit from some of the information you present here.Please let me know if this okay with you. Thanks!

  2. I have read your article carefully and I agree with you very much. So, do you allow me to do this? I want to share your article link to my website: Cryptocurrency Prices

發表迴響