Skip to content

Commit 37e4fad

Browse files
Adds a description for req-source-width-height
1 parent f8da677 commit 37e4fad

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# htmlacademy/req-source-width-height
2+
3+
Правило требует наличие атрибутов `width` и `height` у `<source>`, находящихся внутри `<piture>`.
4+
5+
## true
6+
Если включён, `<source>` без атрибутов `width` и `height` считаются проблемой.
7+
8+
9+
Проблемными считаются следующие шаблоны:
10+
```html
11+
<picture>
12+
<source srcset="images/image-tablet.jpg" media="(min-width: 768px)">
13+
<img src="images/image-mobile.jpg" width="320" height="148" alt="">
14+
</picture>
15+
```
16+
17+
Следующие шаблоны **не** считаются проблемами:
18+
19+
```html
20+
<picture>
21+
<source srcset="images/image-tablet.jpg" width="768" height="480" media="(min-width: 768px)">
22+
<img src="images/image-mobile.jpg" width="320" height="148" alt="">
23+
</picture>
24+
```

0 commit comments

Comments
 (0)