- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Hi guys,
I ran into a strange problem. I want to change the color of a label when the input field is set to :focus. Easy actually. But not when the input is wrapped with a span.
I am pulling my hair. Any idea whats going on?
It’s not working because when you wrap the input in a span, it is no longer adjacent to or a sibling with its label. If you put the label in the span with the input, it will work.
Oh boy. Of course. My head just hit the table :) Thanks guys.
@Paulie_D Its a contact form plugin, which I have to us. And they put the input in a span. Don’t ask me why.
But this leads me to another question. How do I address the label when it has not the same parent.
http://codepen.io/tobau/pen/memMBB?editors=110
Even when I add a class to the label.
Without wrapping both the input and label in the same span, I don’t think it is possible with just css.