Starx
Starx

Reputation: 78971

Styling the Highlighting in CSS

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

Upvotes: 1

Views: 96

Answers (2)

Sarfraz
Sarfraz

Reputation: 382626

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

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

More Info:

Upvotes: 3

Strelok
Strelok

Reputation: 51431

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/

Upvotes: 2

Related Questions