Skip to content

Commit ff9f8eb

Browse files
committed
<img> intro: use the width and height attributes on <source>
1 parent 88c7d93 commit ff9f8eb

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

source

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30640,17 +30640,15 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
3064030640
&lt;/figure></code></pre>
3064130641

3064230642
<p>Alternatively, the <code data-x="attr-dim-width">width</code> and <code
30643-
data-x="attr-dim-height">height</code> attributes can be used to provide the width and height for
30644-
legacy user agents, using CSS just for the user agents that support <code>picture</code>:</p>
30643+
data-x="attr-dim-height">height</code> attributes can be used on the <code>source</code> and
30644+
<code>img</code> elements to provide the width and height:</p>
3064530645

30646-
<pre><code class="html">&lt;style media="(max-width: 600px)">
30647-
#a { width: 100px; height: 100px; }
30648-
&lt;/style>
30646+
<pre><code class="html">
3064930647
&lt;figure>
3065030648
&lt;picture>
30651-
&lt;source srcset="a-square.png" media="(max-width: 600px)">
30649+
&lt;source srcset="a-square.png" media="(max-width: 600px)" width="100" height="100">
3065230650
&lt;img src="a-rectangle.png" width="300" height="150"
30653-
alt="Barney Frank wears a suit and glasses." id="a">
30651+
alt="Barney Frank wears a suit and glasses.">
3065430652
&lt;/picture>
3065530653
&lt;figcaption>Barney Frank, 2011&lt;/figcaption>
3065630654
&lt;/figure></code></pre>

0 commit comments

Comments
 (0)