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.


1 Answer 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.

  • Thanks Dylan. Interesting to know. Cheers!
    – ChasEpes
    Aug 13, 2020 at 19:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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