Add image border when checkbox is checked.

  • Profile Image
    geo89
    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
    ibrahim
    Answered on June 18, 2015 at 07:11 AM

    Hi,

    Can you try this code block: 

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