Files
freeCodeCamp/guide/russian/html/attributes/img-width-attribute/index.md
2018-10-16 21:32:40 +05:30

28 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Img Width Attribute
localeTitle: Атрибут атрибута Img
---
## Атрибут атрибута Img
Атрибут «ширина» HTML относится к ширине изображения. Значение в котировках - это количество пикселей.
Например, если у вас уже есть ссылка на изображение, настроенное с помощью атрибута `src` вы можете добавить атрибут width так:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<title>Img Width Attribute</title>
</head>
<body>
<img src="image.png" alt="Image" width="100"/>
</body>
</html>
```
В приведенном выше фрагменте кода есть тег изображения, а изображение устанавливается на ширину 100 пикселей. `width="100"`
#### Дополнительная информация:
[Статья MDN в теге img](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img)