HTML image size in a table

0

How do I make a smaller image using HTML in this code? I already used Width after the link and it does not work

<a href="window.open('file:///C:/Users/cliente/Desktop/Projeto%20Leticia/Cadastro.html')";>
  <img src= "C:\Users\cliente\Desktop\Projeto\PICON_028.png"/>
</a>
    
asked by anonymous 19.10.2017 / 21:36

2 answers

0

The solution suggested by Rafael clarifies your doubt, however, it sets the same size for all images on the page, which is usually not an appropriate approach. To apply the formatting only in this image is better:

CSS

.minha-imagem{
  width: 50px;
  height: 50px;
}

HTML

<img src= "C:\Users\cliente\Desktop\Projeto\PICON_028.png" class="minha-imagem"/>

Remembering that if you insert the css into an @media query you can set different sizes according to the screen resolution, which would be advisable to adapt the site to mobile devices such as tablets and phones. Hence, for example, it would look like this:

@media only screen and (max-width: 500px) {
    .minha-imagem{
      width: 50px;
      height: 50px;
    }
}
    
20.10.2017 / 01:33
0

You can do this using CSS

img{
  width: 50px;
}
<table>
  <thead>
    <tr>
      <th>Imagem</th>
    </tr>
  </thead>
  
  <tbody>
    <tr>
      <td>
        <a href="window.open('file:///C:/Users/cliente/Desktop/Projeto%20Leticia/Cadastro.html')";><img src= "https://timedotcom.files.wordpress.com/2017/06/kit-harington-got.jpg"/></a>
      </td>
    </tr>
  </tbody>
</table>
    
19.10.2017 / 21:43