Archived topic
need help with css selection
3 replies · Started by Ashok on April 23, 2020
I am trying to add following css onto my child them in the file style.css
the first one is to custom selection color that i found in this group and second one is to change the link color on the right sidebar
**********************************
// STYLE FOR CUSTOM SELECTION COLOR
::selection {
background: #ed008c!important;
color: white;
}
// STYLE FOR SIDEBAR LINK COLOR
.rpwe-img h3 {
color:#ed008c!important;
}
**************************
i am using "tasty" theme. I am not sure where i am wrong, i disabled all the cache plugin, purging cache but still not see the changes on the fron end.
Can someone poing me to the right direction please.
Hi there,
first off you have several PHP codes snippets in your child theme style.css
Every line before this line is PHP:
// STYLE FOR CUSTOM SELECTION COLOR
PHP needs to be added to your child themes function.php
More info here:
https://docs.generatepress.com/article/adding-php/
Secondly this // STYLE FOR CUSTOM SELECTION COLOR is a valid comment in PHP but it is not valid for CSS. Instead you use:
/* This is a valid CSS Comment */
So remove the PHP and the invalid comments and try this CSS:
/* Change selection colors */
::selection {
background: #ed008c !important;
color: white;
}
/* Change Related Post widget title color */
h3.rpwe-title a {
color: #ed008c !important;
}
perfect..thanks
You're welcome