.check ~ span{
position: absolute;
left: 0;
width: 20px;
height: 20px;
border: 1px solid #CCB26E;
display: inline-block;
border-radius: 3px;
}
.check ~ span:before{
content: '';
position: absolute;
background: url('pic.svg');
width: 20px;
height: 20px;
background-repeat: no-repeat;
top: 1px;
right: 0;
left: 2px;
bottom: 0;
opacity: 0;
transition: opacity .3s ease-in-out;
}
.check:checked ~ span:before{
opacity: 1;
}
<div class="currency">
<ul>
<?php
for ( $i = 0; $i < $count_obj; $i++ ) {
if ( $obj[ $i ][ 'percent_change_24h' ] > 0 ) {
$color_change = '#4ac06a';
$plus = '+';
} else {
$color_change = '#ff8d8d';
$plus = '';
}
?>
<li><i class="cc <?=$obj[$i][" symbol "]?> iconsi" title="<?=$obj[$i][" name "]?>"></i>
<div class="block_coin">
<span class="coin_name">
<?=$obj[$i]["name"]?>
</span>
<span style="color:<?=$color_change?>;" class="coin_price">
<?=$obj[$i]["price_usd"]?>$</span>
<span style="color:<?=$color_change?>;" class="coin_change">(<?=$plus.$obj[$i]["percent_change_24h"]?>%)</span>
</div>
</li>
<?php
}
?>
</ul>
</div>