Enllaç d'imatge HTML
Com convertir una imatge en un enllaç.
Codi d'enllaç d'imatge HTML
<a href="../html-link.htm"><img src="flower.jpg" width="82" height="86"
title="White flower" alt="Flower"></a>
O millor utilitzar l'estil CSS per determinar l'amplada i l'alçada.
<a href="../html-link.htm"><img src="flower.jpg" style="width:82px; height:86px"
title="White flower" alt="Flower"></a>
El codi crearà aquest enllaç:
El codi té les parts següents:
- <a> és l'etiqueta d'enllaç.
- L'atribut href estableix l'URL al qual s'enllaça.
- <img> és l'etiqueta inicial de la imatge.
- L'atribut src estableix el fitxer d'imatge.
- L'atribut title estableix el text d'informació eines de la imatge.
- alt és l'atribut de text alt de l'etiqueta d'imatge.
- L'atribut style estableix amb css l'amplada i l'alçada de la imatge.
- </a> és l'etiqueta final de l'enllaç.
Vegeu també