Tag: selection

  • CSS 變更選取文字的背景色

    在 CSS3 的規範中,多了一些選擇器 ( selector ) 的定義,提供設計師更多元的元素操作方法。其中一項新增的選擇器是 ::selection,表示被選取的文字。 透過這項選擇器便能做出不同的選取區背景色。簡單的範例如下 <style> p.yellow::selection { background: #fff2a8; } p.yellow::-moz-selection { background: #fff2a8; } </style> 選取以下的文字試試 If you want a reason as to why this decision has been made, Blizzard is happy to provide you with two. The first is of course piracy, which they believe an always-connected game…

Exit mobile version