I have something like this
<form class="Form">
<FormField>
<label class="FormLabel" ..>
<div class="FormInput">
<div class="InputField">
<input../>
</div>
</div>
</FormField>
</form>
I need to apply styles to FormLabel
when input
is focussed.
I understand that we cant get the parent selector
(Is there a CSS parent selector?)
I want a work around to access the parent using css only (not use jquery)
I tried this using &
in LESS
.Form {
.FormField {
.Input:focus & .FormLabel {
border:green
}
}
}
Still no luck :/ .. What am I missing? Thanks!