Forum Moderators: not2easy
I'm trying to get a label that normally has a dotted border to have a solid border when the input within it is focused.
Here is the basic code...
<label class="posticon" for="example"><input id="example" /></label>
So first I use the selector to select the specific label element(s)...
label.posticon {}
Then I select the state of the input element...
label.posticon input:focus {}
But beyond that I don't know how to reselect the label which I doubt is possible?
Remember I only want to set the border (of the label itself) to solid when it's (sub-element) input is focused (to denote that the option has been selected and remains selected).
Another issue may be that when the user focuses on another element that the focus is lost? Suggestions? If there are any JS suggestions please keep in mind the pages will be served as application/xhtml+xml. :)
John
input:focus, input:focus + label { border: 5px solid red; } Of course, IEs less than 7 don't understand that, but then IE doesn't understand :focus anyway.