HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p>We learned about the basic image formats, but Muffin again sent us some corrections. When he tried to read our entry, some of the images did not fit on the screen of his monitor, and some were hard to see. This is because we forgot to think about the image dimensions.</p>
1 <p>We learned about the basic image formats, but Muffin again sent us some corrections. When he tried to read our entry, some of the images did not fit on the screen of his monitor, and some were hard to see. This is because we forgot to think about the image dimensions.</p>
2 <p>In HTML, you must use the width and height attributes in order to control image width and height. The dimensions are specified without units in px in these attributes. For example:</p>
2 <p>In HTML, you must use the width and height attributes in order to control image width and height. The dimensions are specified without units in px in these attributes. For example:</p>
3 &lt;img src="logo.png" width="200" height="100"&gt;<p>In the example above, the image has been assigned a width of 200px and a height of 100px.</p>
3 &lt;img src="logo.png" width="200" height="100"&gt;<p>In the example above, the image has been assigned a width of 200px and a height of 100px.</p>
4 <p>If you specify only one of the dimensions, whether width or height, then the browser will calculate the second dimension independently based on the image proportions.</p>
4 <p>If you specify only one of the dimensions, whether width or height, then the browser will calculate the second dimension independently based on the image proportions.</p>
5 <p>By the way, you need to be very careful when working with image height and width: if you specify both the height and the width at the same time, then the browser may display the image disproportionally.</p>
5 <p>By the way, you need to be very careful when working with image height and width: if you specify both the height and the width at the same time, then the browser may display the image disproportionally.</p>