Complete the code to add an image with a width of 200 pixels.
<img src="flower.jpg" alt="A red flower" width="[1]">
The width attribute sets the image width in pixels. Here, 200 means 200 pixels wide.
Complete the CSS code to set the image height to 150 pixels.
img {
height: [1];
}In CSS, you must specify units like px for pixel sizes. So 150px sets height to 150 pixels.
Fix the error in the HTML to make the image width 300 pixels.
<img src="tree.jpg" alt="A tall tree" width="[1]">
The width attribute in HTML expects a number only, without units. So use 300, not 300px.
Fill both blanks to set the image width to 100 pixels and height to auto in CSS.
img {
width: [1];
height: [2];
}Setting width to 100px fixes the width. Setting height to auto keeps the image's natural height ratio.
Fill all three blanks to create a responsive image that fills its container width but keeps its aspect ratio.
<img src="mountain.jpg" alt="A mountain" style="width: [1]; height: [2]; max-width: [3];">
Setting width to 100% makes the image fill its container's width. Height auto keeps the aspect ratio. Max-width 100% prevents the image from growing larger than its container.