Is there a CSS parent selector?

Is there any way to select the <li> element that is a direct parent of the anchor element? For an example, the CSS would be something like this:

li < a.active {
    property: value;
}

No, currently no way to select the parent of an element in CSS.

If there was a way to do it, it would be in either of the current CSS selectors specs:

That said, the Selectors Level 4 Working Draft includes a :has() pseudo-class that will provide this capability. It will be similar to the jQuery implementation.

li:has(> a.active) { /* styles to apply to the li tag */ }

However, as of May 2020, this is still not supported by any browser.

In the meantime, you'll have to resort to JavaScript if you need to select a parent element. But the following works with jQuery:

$("a.active").parents('li').css("property", "value");

From Stackoverflow Is there a CSS parent selector?