Which CSS property is used to control the size of an image?
Analysis & Theory
You can control the size of an image using the `width` and `height` properties.
What does `object-fit: cover;` do to an image?
A
Scales the image to completely fill its container, possibly cropping it
B
Stretches the image to fit exactly
C
Repeats the image to fill the container
D
Adds a border to the image
Analysis & Theory
`object-fit: cover;` makes the image fill its container while maintaining aspect ratio, and it may crop.
How can you make an image perfectly circular?
D
shape-outside: circle();
Analysis & Theory
Setting `border-radius: 50%` on a square image makes it appear circular.
Which property adds a shadow effect to an image?
Analysis & Theory
`box-shadow` adds a shadow around an image or any block-level element.
How can you make an image semi-transparent in CSS?
C
background: transparent;
Analysis & Theory
`opacity` controls the transparency of an element. `0.5` makes the image 50% transparent.
Which CSS property applies grayscale, blur, or brightness effects to an image?
Analysis & Theory
`filter` allows visual effects like `grayscale()`, `blur()`, `brightness()`, etc.
What does `max-width: 100%;` do for responsive images?
A
Stretches the image to 100% of the screen
B
Ensures the image doesn't exceed its container width
C
Fixes the image width to 100px
D
Removes padding from the image
Analysis & Theory
`max-width: 100%;` ensures the image scales down with the container and doesn’t overflow.
Which property can round only one corner of an image?
B
border-radius: top-left;
C
border-top-left-radius: 10px;
D
round-corner: top-left 10px;
Analysis & Theory
`border-top-left-radius` applies rounding only to the top-left corner.
How do you apply a hover zoom effect to an image using CSS?
A
transform: scale(1.2) on :hover
Analysis & Theory
You can use `transform: scale(1.2)` inside a `:hover` rule to zoom in on an image when hovered.
Which CSS property is used to crop images with a custom shape?
Analysis & Theory
`clip-path` lets you crop an image into shapes like circles, polygons, or ellipses.