Add image border when checkbox is checked.

  • Profile Image
    Asked on June 18, 2015 at 05:38 AM

    I would like this to happen when checking the image of the checkbox:


    I have tried the following but doesn't seem to work.

    .form-radio:checked  ~  img {
        border : 3px solid #DD0021;
        display : block;

  • Profile Image
    Answered on June 18, 2015 at 07:11 AM


    Can you try this code block: 

    .form-radio:checked + label img {
      border: 4px solid #F00;