Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
GeoPal
Experienced
Topic Author
Posts: 227
Joined: 20 Dec 2007, 12:56

Highlight color after selection

08 Nov 2017, 09:51

Hi Karl,
Wanted to ask you if there is any setting for the colour of text highlight after selection with mouse? I couldn't find it and now it maybe is the default for the browser.
Is there a way to change the colour with css?
Thank you, George
Attachments
2017-11-08 16_49_19-Еднофамилна къща Драгалевци 2017.jpg
2017-11-08 16_49_19-Еднофамилна къща Драгалевци 2017.jpg (52.74 KiB) Viewed 12869 times
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Highlight color after selection

08 Nov 2017, 09:56

Check this link:
https://css-tricks.com/almanac/selectors/s/selection/

You will have to add custom CSS naturally.
 
User avatar
GeoPal
Experienced
Topic Author
Posts: 227
Joined: 20 Dec 2007, 12:56

Re: Highlight color after selection

10 Nov 2017, 04:25

Thank you Karl, worked like a charm!
Best, George
 
User avatar
GeoPal
Experienced
Topic Author
Posts: 227
Joined: 20 Dec 2007, 12:56

Re: Highlight color after selection

10 Nov 2017, 10:18

p.s.
In the text body it works, but it doesn't in the Title and description. Any idea? 

Link
This is the code I put in custom css:

Code
p::selection {
  background-color: #000;
  color: white;
}
Thank you! 
G
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: Highlight color after selection

10 Nov 2017, 10:38

Because the p:: means it will target all <p> paragraph items only, and your "content" is generally made up from paragraphs.

You could add the selection class GLOBALLY like this:
Code
::selection {
  background-color: #000;
  color: white;
}
It might not be a good idea to add the selection style to EVERYTHING though (menu's etc). To also target headers (including title and description), you might want to try this instead:
Code
p::selection, h1::selection, h2::selection {
  background-color: #000;
  color: white;
}