You are viewing limited content. For full access, please sign in.

Question

Question

Change text color from check box.

asked on June 27, 2014

How would I have the text color of the text beside a check box change when the check box is highlighted. It only becomes highlighted when it is clicked. How would I also change it back to the original color when it is no longer highlighted?

0 0

Answer

SELECTED ANSWER
replied on June 27, 2014 Show version history

You can use a CSS rule like this:

 

input:checked + label {
  color: red;
}

If you only want to change the text color when the field is highlighted, try this:

 

.form-focused input:checked + label {
  color: red;
}

 

0 0

Replies

replied on June 27, 2014

Exactly what I was looking for.

 

I also used 

.form-focused label {

 color: white ;

}

And everything looks perfect, thanks again!

0 0
replied on June 27, 2014

You're welcome!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.