28 lines
1.1 KiB
Markdown
28 lines
1.1 KiB
Markdown
---
|
||
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) |