--- id: bad87fee1348bd9aedf08812 title: Add Images to Your Website challengeType: 0 guideUrl: 'https://spanish.freecodecamp.org/guide/certificates/add-images-to-your-website' videoUrl: '' localeTitle: Añadir imágenes a su sitio web --- ## Description
Puede agregar imágenes a su sitio web usando el elemento img y apuntar a la URL de una imagen específica usando el atributo src . Un ejemplo de esto sería: <img src="https://www.your-image-source.com/your-image.jpg"> Tenga en cuenta que los elementos img se cierran automáticamente. Todos los elementos img deben tener un atributo alt . El texto dentro de un atributo alt se usa para que los lectores de pantalla mejoren la accesibilidad y se muestra si la imagen no se carga. Nota: si la imagen es puramente decorativa, usar un atributo alt vacío es una buena práctica. Idealmente, el atributo alt no debe contener caracteres especiales a menos que sea necesario. Agreguemos un atributo alt a nuestro ejemplo de img anterior: <img src="https://www.your-image-source.com/your-image.jpg" alt="Author standing on a beach with two thumbs up.">
## Instructions
Intentemos agregar una imagen a nuestro sitio web: inserte una etiqueta img , antes del elemento h2 . Ahora establezca el atributo src para que apunte a esta url: https://bit.ly/fcc-relaxing-cat Finalmente, no se olvide de darle a su imagen un texto alt .
## Tests
```yml tests: - text: Tu página debe tener un elemento de imagen. testString: 'assert($("img").length > 0, "Your page should have an image element.");' - text: Tu imagen debe tener un atributo src que apunte a la imagen del gatito. testString: 'assert(new RegExp("\/\/bit.ly\/fcc-relaxing-cat|\/\/s3.amazonaws.com\/freecodecamp\/relaxing-cat.jpg", "gi").test($("img").attr("src")), "Your image should have a src attribute that points to the kitten image.");' - text: Su elemento de imagen debe tener un atributo alt . testString: 'assert(code.match(/alt\s*?=\s*?(\"|\").*(\"|\")/), "Your image element must have an alt attribute.");' ```
## Challenge Seed
```html

CatPhotoApp

Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.

Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.

```
## Solution
```js // solution required ```