wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

[WEB3] 6b. Astro Images

Total questions: 24

Worksheet time: 12mins

Name
Class
Date
1.

What are the built-in Astro components mentioned for handling images?

a)

<Img /> and <Pic />

b)

<Image /> and <Picture />

c)

<Photo /> and <Gallery />

2.

Is Markdown image syntax supported in Astro?

a)

Yes

b)

No

c)

Only for remote images

3.

How can SVGs be used in Astro as per the document?

a)

Only as background images

b)

As components

c)

Not supported at all

4.

What feature does Astro provide for responsive images?

a)

Manual coding of all resizes

b)

Automatically resizing responsive images

c)

No image resizing support

5.

Where should local images be placed to benefit from all Astro image features?

a)

In /src

b)

In /public

c)

In /assets

6.

For remote images in Astro, what is required?

a)

Convert them to local files

b)

Authorize domains

c)

No special requirements

7.

What does Astro automatically generate when responsive properties are applied to <Image /> or <Picture />?

a)

Only alt text and styles

b)

Required srcset and sizes values

c)

Manual overrides only

8.

What should be filled in the blue box?

a)

automatically generate the required srcset and sizes values for your images, and apply the necessary styles

b)

require you to manually specify widths, densities, and custom CSS for every breakpoint

c)

only optimize image formats (like AVIF/WebP) but leave resizing and srcset handling to custom code

9.

When might you need to adjust the sizes attribute manually for best results?

a)

For all image layouts

b)

Only for full-width images

c)

If in a multi-column layout on small screens

10.

Which layout options are available for responsive images in Astro, as detailed in the referenced docs?

a)

Fixed and fluid

b)

Constrained and full-width

c)

Cover and contain

d)

Responsive and adaptive

e)

None, layouts are manual

11.

What is the requirement for the alt attribute in Astro's <Image /> and <Picture /> components?

a)

Optional for local images

b)

Mandatory for accessibility

c)

Only needed for remote images

d)

Deprecated in recent versions

e)

Automatically generated

12.

How can you override Astro's automatically generated widths and sizes in a practical code example?

a)

Through global CSS only

b)

By providing widths and sizes props directly

c)

In the Astro config file

d)

Using Markdown syntax

e)

Can't be overridden

13.

What happens to images placed in the /public folder in Astro regarding optimization and responsive behavior?

a)

They are fully optimized and responsive

b)

They are never optimized and lack responsive behavior

c)

Optimized but not responsive

d)

Responsive but not optimized

e)

Depends on file type

14.

Use the HTML <img> element when you cannot use the <Image /> component, for example:

a)
  • for unsupported image formats

b)
  • when you do not want your image optimized by Astro

c)
  • to access and change the src attribute dynamically client-side

d)

when the image is an SVG file

e)

when using the image inside a client-side interactive UI framework component like React or Vue without passing it as a prop

15.

What sizes attribute does Astro typically generate for this constrained image?

a)

100vw

b)

(min-width: 800px) 800px, 100vw

c)

(max-width: 800px) 800px

d)

No sizes attribute

16.

Which statement is true about the generated HTML for this fixed-layout image?

a)

It includes a srcset with multiple widths

b)

No srcset or sizes is generated

c)

It automatically gets sizes="100vw"

d)

It applies width: 100% style

17.

What is the typical sizes attribute generated for a fullWidth layout image?

a)

100vw

b)

(min-width: 1200px) 1200px, 100vw

c)

No sizes (only srcset)

d)

Fixed pixel value like 1920px

18.

What does this code primarily achieve?

a)

Forces a fixed size image

b)

Provides multiple format sources (AVIF first, then WebP, with fallback)

c)

Generates only a srcset for widths

d)
  • Disables image optimization

19.

You place an image file at /public/images/photo.jpg and reference it as <img src="/images/photo.jpg" />.
Compared to placing it in /src/assets/ and using <Image />, what happens?

a)

It gets full optimization and responsive srcset

b)

It is served as-is without optimization or responsive features

c)

It automatically converts to AVIF

d)

It requires domain authorization

20.

For this remote image to be optimized by Astro, what must you do?

a)

Nothing, all remote images are optimized

b)

Authorize the domain (e.g., example.com) in astro.config.mjs

c)

Add layout="constrained"

d)

Use <Picture /> instead

21.

Your layout places a constrained image in a two-column grid on mobile (expected ~50vw width on small screens).
Astro generates sizes="(min-width: 800px) 800px, 100vw".
What should you do for optimal performance?

a)

Leave it as-is

b)

Manually override with a custom sizes prop (e.g., sizes="(min-width: 800px) 800px, 50vw")

c)

Change to layout="fixed"

d)
  • Remove the width prop

22.

How does Astro apply the fit and position props?

a)

Directly as HTML attributes

b)

Via CSS variables (--fit: contain; --pos: top) on the img element

c)

Only if responsiveStyles is disabled

d)

They are ignored in constrained layout

23.

What is the default responsive behavior for an inline layout image?

a)

Full srcset and sizes like constrained

b)

No automatic srcset/sizes or special responsive styles

c)

Always 100vw sizes

d)

Forces object-fit: cover

24.

The code is in astro.config.mjs. What effect does this global config have?

a)

All images become fixed size

b)

Responsive behavior (srcset, sizes, styles) applies by default to all <Image /> and <Picture />

c)

Only remote images get srcset

d)

Disables AVIF/WebP formats