Skip to content

Courses / CSS3 Mastery: Beginner to Advanced / Width, Height, Box Sizing, Overflow and Visibility

2,092 people viewed this

Width, Height, Box Sizing, Overflow and Visibility

  1. What does max-width: 100% commonly help prevent? (A) Content exceeding its containing width (B) All images loading (C) Fonts inheriting (D) Grid creation. Answer: A. It constrains width to the available reference size.
  2. What does overflow: auto do? (A) Enables scrolling when necessary (B) Always hides content (C) Deletes children (D) Removes borders. Answer: A. Scrolling is available when content overflows.
  3. Which value clips overflow without creating a scroll container? (A) clip (B) visible (C) auto (D) inherit only. Answer: A. overflow: clip clips content without scroll-container behavior.
  4. What happens with display: none? (A) The element's box is removed from layout (B) The element remains fully visible (C) Only text changes color (D) It becomes fixed. Answer: A. It generates no layout box.
  5. What happens with visibility: hidden? (A) Layout space is preserved (B) The element is deleted (C) Width becomes zero always (D) All siblings disappear. Answer: A. The element remains in layout but is not visible.
  6. Does opacity: 0 automatically disable pointer interaction? (A) Yes (B) No (C) Only in Grid (D) Only in Firefox. Answer: B. Transparency alone does not disable interaction.
  7. What does aspect-ratio: 16 / 9 express? (A) Preferred width-to-height ratio (B) Sixteen columns always (C) Nine pixels of padding (D) Font weight. Answer: A. It establishes a preferred box ratio.
  8. What does object-fit: cover do? (A) Fills the box while preserving aspect ratio, potentially cropping (B) Stretches every image without limits (C) Hides the box (D) Adds padding. Answer: A. Cover fills the box and may crop content.
  9. Which function sets minimum, preferred and maximum values? (A) clamp() (B) rgb() (C) url() (D) attr() only. Answer: A. Clamp constrains a preferred value between bounds.
  10. What can happen with percentage height and an indefinite containing-block height? (A) The percentage may behave as auto (B) It always equals 1000px (C) The element is deleted (D) It becomes a font size. Answer: A. Percentage height needs an appropriate reference size.

Key Takeaways

  • Use min/max constraints for flexible sizing.
  • Choose overflow behavior based on the intended interaction.
  • Display, visibility and opacity have different layout and interaction effects.

Rate this course

No ratings yet — yours can be the first.

Stars show on this course. Your written note stays private.

Your stars