JSFiddle - React, Tailwind, and code Playground

by priyanka tiwari

HTML

<div class="options">
    <label title="item1">
        <input type="radio" name="foo" value="0" /> 
      Item 1
        <img />
              
   </label>
    <label title="item2">
        <input type="radio" name="foo" value="1" />
        Item 2
        <img />
    </label>   
    <label title="item3">
        <input type="radio" name="foo" value="2" />
        Item 3
        <img />
    </label>
</div>

CSS

div.options > label > input {
    visibility: hidden;
}

div.options > label {
    display: block;
    margin: 0 0 0 -10px;
    padding: 0 0 48px 0;  
    height: 20px;
    width: 150px;
    
}

div.options > label > img {
    display: inline-block;
    padding: 0px;
    height:60px;
    width:60px;
    background: url(https://cdn2.iconfinder.com/data/icons/snipicons/500/thumbs-down-128.png);
    background-repeat: no-repeat;
    background-position:center center;
    background-size:60px 60px;
}

div.options > label > input:checked +img {  
    background: url(https://cdn1.iconfinder.com/data/icons/onebit/PNG/onebit_34.png);
    background-repeat: no-repeat;
    background-position:center center;
    background-size:60px 60px;
}