0
0
HTMLmarkup~5 mins

Image sizing basics in HTML - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What attribute controls the width of an image in HTML?
The width attribute controls the width of an image in HTML. You can set it in pixels or as a percentage.
Click to reveal answer
beginner
How do you keep an image's aspect ratio when resizing it?
To keep the aspect ratio, set only width or height, not both. The browser adjusts the other dimension automatically.
Click to reveal answer
beginner
What CSS property can you use to control image size?
You can use the CSS properties width and height to control image size. For example, img { width: 50%; height: auto; }.
Click to reveal answer
beginner
What happens if you set both width and height attributes to different proportions than the original image?
The image will stretch or squash, changing its original shape and possibly looking distorted.
Click to reveal answer
intermediate
Why is it better to use CSS for image sizing instead of HTML attributes?
Using CSS separates content from design, making it easier to update styles and keep HTML clean. CSS also offers more control and responsiveness.
Click to reveal answer
Which attribute sets the width of an image in HTML?
Awidth
Bsize
Clength
Dscale
If you want to keep an image's shape, what should you do when resizing?
ASet both width and height to new values
BSet only width or only height
CSet width and height to zero
DUse the <code>size</code> attribute
Which CSS property is used to control image height?
Amargin
Bfont-size
Cheight
Dpadding
What is the visual effect of setting width and height to values that don't match the image's original ratio?
AImage stretches or squashes
BImage becomes blurry
CImage disappears
DImage stays the same
Why is CSS preferred over HTML attributes for image sizing?
ACSS is faster to write
BHTML attributes don't work in modern browsers
CCSS makes images load faster
DCSS allows better control and responsiveness
Explain how to resize an image in HTML while keeping its original shape.
Think about which attribute to set to avoid distortion.
You got /4 concepts.
    Describe the difference between resizing images using HTML attributes and CSS.
    Consider how design and content are managed.
    You got /4 concepts.