0

I need help to set the background of a list view column header but not just the ms-vh-div. I need to set the entire column width background of the header. This code only sets the background around the text.

.ms-vh-div[DisplayName="Column1"]
{
background-color:#FFFF66;
}
1

There is currently no way to select a parent element in pure CSS. The closest thing is that there is a :has() pseudo-class proposed for CSS4, but according to this answer over on StackOverflow:

as of 2020, this is still not supported in any browser.

So, you are going to be stuck using Javascript of some sort (vanilla? jQuery?) in order to get that done.

1
  • Thanks Dylan. Interesting to know. Cheers! – ChasEpes Aug 13 '20 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.