Place image to represent file depending on CSS extension

Asked

Viewed 24 times

-1

Good evening, it is possible to customize the appearance of a file displayed depending on the type of extension (docx, pdf, xlsx) with CSS?

For example, I display my files that are in a directory through a href, I want that when it is a WORD file, it displays a WORD image and the name of the file just below, preferably inside the image, as I can be doing this?

Code:

<?php

require('conexaobd.php');

$sql = "SELECT relatorio.*, pacientes.nome, pacientes.data_saida FROM relatorio,pacientes WHERE relatorio.paciente=pacientes.nome";

$resultado = mysqli_query($link, $sql);

$inc = 0;

while ($cont = mysqli_fetch_array($resultado)) {


echo '
    <tr>
        echo $cont['relatorio_educacao_fisica'] != "" ? "<td><a href='ver-arquivo.php?documento=uploads/uploadsed/{$cont['relatorio_educacao_fisica']}' title='{$cont['relatorio_educacao_fisica']}' target='_blank'></a></td>" : "<td></td>";           
    ';
}

?>   
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.