CodeHS Web Design (Picasso) Practice Test 2025 – The Comprehensive All-in-One Guide to Mastering Web Design!

Question: 1 / 400

Which code snippet will select all <img> tags on a page and set their height to 200 pixels?

img { height: 200px; }

The code snippet that selects all `<img>` tags on a page and sets their height to 200 pixels is valid because it uses the correct CSS syntax for selecting elements and applying styles. In CSS, to target specific HTML elements, you write the element name (in this case, `img`) followed by a set of curly braces containing the styles you want to apply.

The declaration `height: 200px;` specifies that the height of all `<img>` elements should be set to 200 pixels, using the proper unit of measurement (pixels) indicated by "px." This is the standard format for defining styles in CSS, making this choice effective and appropriate for styling.

Other options provided contain syntax issues or incorrect selectors that prevent them from functioning as intended. For instance, simply writing `height: 200;` lacks the necessary unit (like pixels), which is crucial for proper interpretation by browsers. Similarly, using `<img>` within a style block is incorrect syntax for CSS, as it should only contain selectors, not HTML tags. Lastly, adding "All" before `img` is not a recognized way to specify the element in CSS, making that option invalid as well.

Get further explanation with Examzify DeepDiveBeta

img { height: 200; }

<img> { height: 200px; }

All img { height: 200px; }

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy