Is it possible to apply a style to the outer div in this example, using only CSS and the fact that there is an inner div of class "error"?
<div>
<div class = "error">
</div>
</div>
I know I could do it in javascript.
EDIT
Since it's not possible in pure css, is it really inefficient to do something like this? Is there a cleaner way? I can't easily change the dom. For background, the error classes are automatically wrapped around labels/inputs in rails but I want to style the containing DIVs.
$(".error").parent().addClass("error-wrapper");