--- id: bad87fee1348bd9aedf08812 title: Add Images to Your Website challengeType: 0 guideUrl: 'https://portuguese.freecodecamp.org/guide/certificates/add-images-to-your-website' videoUrl: '' localeTitle: Adicionar imagens ao seu site --- ## Descrição
Você pode adicionar imagens ao seu site usando o elemento img e apontar para o URL de uma imagem específica usando o atributo src . Um exemplo disso seria: <img src="https://www.your-image-source.com/your-image.jpg"> Note que os elementos img são de fechamento automático. Todos os elementos img devem ter um atributo alt . O texto dentro de um atributo alt é usado para leitores de tela para melhorar a acessibilidade e é exibido se a imagem não for carregada. Nota: Se a imagem é puramente decorativa, usar um atributo alt vazio é uma prática recomendada. Idealmente, o atributo alt não deve conter caracteres especiais, a menos que seja necessário. Vamos adicionar um atributo alt ao nosso exemplo de img acima: <img src="https://www.your-image-source.com/your-image.jpg" alt="Author standing on a beach with two thumbs up.">
## Instruções
Vamos tentar adicionar uma imagem ao nosso site: Insira uma tag img antes do elemento h2 . Agora defina o atributo src para que aponte para este URL: https://bit.ly/fcc-relaxing-cat Por fim, não se esqueça de dar à sua imagem um texto alt .
## Tests
```yml tests: - text: Sua página deve ter um elemento de imagem. testString: 'assert($("img").length > 0, "Your page should have an image element.");' - text: Sua imagem deve ter um atributo src que aponte para a imagem do gatinho. 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: Seu elemento de imagem deve ter um atributo alt . testString: 'assert(code.match(/alt\s*?=\s*?(\"|\").*(\"|\")/), "Your image element must have an alt attribute.");' ```
## Desafio semente
```html Gatinho

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.

```
## Solução
```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.

```