topskill.dev
CoursesTracks
0
All courses/CSSSizing and Overflow
Layout Fundamentals
7 / 10
← CSS
○CSS Rule Style an Exhibit Card○Write Your First CSS Rule○CSS Selectors Target Exhibit Details○Target Exhibit Details○Apply CSS Three Sources○Apply CSS Three Ways○Specificity Resolve a Style Conflict○Resolve Specificity○Inheritance and the cascade✦Module Quiz
○Color Palette○Color Palette○Background Layer○Background Layer○Type Rhythm○Type Rhythm○Borders and Shadows○Borders and Shadows✦Module Quiz
○Box Model Seed Packet Card○Space a Seed Packet○Display Swap Table Labels○Arrange Swap Table Labels○Positioning Pickup Pin○Pin the Pickup Location●Sizing and Overflow○Size a Seed-Swap Notice○Sticky scroll headings✦Module Quiz
○Advanced Selectors Book Cart Sign○Target a Book Cart Sign○Pseudo-Classes Night Cart States○Style Night Cart States○Pseudo-Elements○Add a Book-Quote Mark✦Module Quiz
○Lantern Market navigation○Lantern Market navigation✦Module Quiz
○Community garden request card○Community garden request card✦Module Quiz
○Flex Direction○Flex Direction○Main-Axis Spacing○Main-Axis Spacing○Cross-Axis Alignment○Cross-Axis Alignment○Wrapping and Flex Items○Wrapping and Flex Items○Flexbox Navigation○Flexbox Navigation✦Module Quiz
○Grid Tracks○Grid Tracks○Grid Gaps○Grid Gaps○Grid Placement○Grid Placement○Responsive Grid○Responsive Grid✦Module Quiz
○River radio schedule○Harbor radio schedule✦Module Quiz
○Field note color system○Field note color system○Transforms○Rotate a Field Note○Resilient styles✦Module Quiz
○Kite festival signal○Garden festival signal✦Module Quiz
○Garden forecast○Harbor forecast○Fluid sizing○Fluid weather bulletin○Images that fit✦Module Quiz
○Seed inventory table○Tool checkout table✦Module Quiz
○Community maker profile○Maker profile sheet✦Module Quiz

Sizing and Overflow

Keep long notes inside their cards

One seed-swap note is much longer than the other. Instead of hiding its words or letting them spill onto the page, this demo limits the card's height and lets readers scroll inside it.

width: 14rem gives .card a preferred width. max-width: 100% caps it at the containing row's width. max-height: 7rem limits height but does not force a short note to fill that height. A rem is relative to the root font size; this page uses the browser's default.

overflow: auto allows scrolling when content does not fit. visible, the default, lets extra content paint outside the box. hidden clips it without offering a scrollbar, which is not what this reading task needs. The supplied Flexbox row arranges the cards; its rules come later. Its supplied alignment keeps the cards at their own heights while lining up their top edges.

Scroll the long note

Run, place the pointer over the long card, and scroll to its final sentence. Your device may show a scrollbar only while scrolling. Set overflow: visible and Run to see the spill, then restore auto.

Narrow the preview. The 100% maximum keeps cards within the row. The diagram illustrates these states rather than measuring your viewport.

Hint 1
1 / 2
HINT 1

Change one CSS value, then run the preview.

HINT 2

Restore the original value before continuing.

Files
  • ⋄index.html
  • ⋄style.css
Loading editor…