How do I display a link icon in custom modules? I would like to display an icon of correct answer but in my condition full URL is displaying (it's not displaying icon ) how I'll manage.
This icon will be on a table so the user can click that icon and check the answer. please guide me where I'm doing wrong. here I have put some linking portion of my code. I'm writing custom modules in drupal 8.
Thanks 

$imgsrc = $base_url.'/scp/sites/default/files/images/corr_icon.gif'; 
$correct_link = Url::fromUserInput('/answer/'.base64_encode($data-&gt;ans_refno).'by'.base64_encode($data-&gt;q_id));
'isanswer' =&gt; \Drupal::l($imgsrc, $correct_link),
You can convert markup with image tags and convert it into URL with image like below:

use Drupal\Core\Render\Markup;

$imgsrc = Markup::create("&lt;img src ='$base_url/scp/sites/default/files/images/corr_icon.gif'&gt;");
$correct_link = Url::fromUserInput('/answer/'.base64_encode($data-&gt;ans_refno).'by'.base64_encode($data-&gt;q_id));
'isanswer' =&gt; \Drupal::l($imgsrc, $correct_link),