freeCodeCamp/guide/portuguese/html/attributes/img-width-attribute/index.md

28 lines
791 B
Markdown
Raw Normal View History

---
title: Img Width Attribute
localeTitle: Atributo Img Width
---
## Atributo Img Width
O atributo "largura" do HTML se refere à largura de uma imagem. O valor nas cotações é a quantidade de pixels.
Por exemplo, se você já tiver um link para uma imagem configurada por meio do atributo `src` poderá adicionar o atributo width da seguinte forma:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Img Width Attribute</title>
</head>
<body>
<img src="image.png" alt="Image" width="100"/>
</body>
</html>
```
No snippet de código acima, há uma tag de imagem e a imagem é definida para uma largura de 100 pixels. `width="100"`
#### Mais Informações:
[Artigo do MDN sobre a tag img](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img)