<!-- Please follow this checklist and put an x in each of the boxes, like this: [x]. It will ensure that our team takes your pull request seriously. --> - [x] I have read [freeCodeCamp's contribution guidelines](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/CONTRIBUTING.md). - [x] My pull request has a descriptive title (not a vague title like `Update index.md`) - [x] My pull request targets the `master` branch of freeCodeCamp.
1.4 KiB
title, localeTitle
| title | localeTitle |
|---|---|
| Img Src Attribute | Atributo Img Src |
Atributo Img Src
El atributo <img src> refiere a la fuente de la imagen que desea mostrar. La etiqueta img no mostrará una imagen sin el atributo src . Sin embargo, si configura la fuente en la ubicación de la imagen, puede mostrar cualquier imagen.
Hay una imagen del logotipo de freeCodeCamp ubicado en https://avatars0.githubusercontent.com/u/9892522?v=4&s=400
Puedes establecer eso como la imagen usando el atributo src .
<html>
<head>
<title>Img Src Attribute Example</title>
</head>
<body>
<img src="https://avatars0.githubusercontent.com/u/9892522?v=4&s=400">
</body>
</html>
El código de arriba se muestra así:
El atributo src es compatible con todos los navegadores.
También puede tener un archivo alojado localmente como su imagen.
Por ejemplo, <img src="images/freeCodeCamp.jpeg> funcionaría si tuviera una carpeta llamada images que tuviera freeCodeCamp.jpeg dentro, siempre y cuando la carpeta 'images' estuviera en la misma ubicación que el archivo index.html .
../files/index.html
..files/images/freeCodeCamp.jpeg