tags:

views:

37

answers:

2

Is it possible to change the background color and foreground color (or text color) of the highlighted portion in a HTML page? In another words, customize the hightlighting of our Webpage

+2  A: 

Only with CSS3 (modern browsers only, obviously), if you want to use pure CSS.

http://css-tricks.com/overriding-the-default-text-selection-color-with-css/

Strelok
+3  A: 

If I understand you correctly, you are looking for these styles:

  • ::selection (General)
  • ::-moz-selection (For Mozilla)
  • ::-webkit-selection (For Webkit)

More Info:

Sarfraz
+1 for including the actual information rather than just linking externally
Bobby Jack