English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
必需的src属性指定图像的URL,网页加载时;那时是浏览器从Web服务器获取图像并将其插入页面。
图像标记如下:
<!DOCTYPE html> <html> <head> <title>HTML:<img> src 属性 - 基础教程网 oldtoolbag.com</title> <body> <img src="haha.gif" alt="haha face" width="42" height="42"> </body> </html>Prueba y mira ‹/›
IEFirefoxOperaChromeSafari
Todos los navegadores principales admiten el atributo src.
El atributo src obligatorio especifica la URL de la imagen.
Nota: Al cargar la página web, es cuando el navegador obtiene la imagen del servidor web y la inserta en la página. Por lo tanto, asegúrese de que la imagen esté ubicada en el mismo lugar relativo a la página web, de lo contrario, sus visitantes obtendrán iconos de enlace roto. Si el navegador no encuentra la imagen, se mostrará un icono de enlace roto.
Ninguno.
<img src="URL">
Valor | Descripción |
---|---|
URL | URL de la imagen. Valores posibles: URL absoluta - Se refiere a otro sitio web (por ejemplo, SRC = “http:)//www.example.com/image.gif”) URL relativa - Se refiere a un archivo dentro de un sitio web (por ejemplo, SRC = “Image.gif”) |