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

28 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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)