HTML & CSS / Adaptable interfaces / Lesson 14
Build an intrinsic responsive card grid
Let available container space determine card columns while preserving readable content and semantic structure.
On this page
Lesson goals
- Use an intrinsic grid rather than fixed device widths.
- Bound a track minimum by the available space.
- Test long content, zoom, and direction.
- Model automatic card tracks using available width, minima and gaps.
- Diagnose item and content overflow while preserving semantics and interaction.
Start with meaningful content
A card layout should retain a sensible document order when displayed as one column. The example uses a labelled section containing articles with headings and descriptions; the grid changes presentation, not the reading sequence. Use links or buttons only when the card actually provides navigation or an action. Content should remain understandable without CSS, including when a user applies a custom stylesheet.
Define flexible tracks
The CSS uses auto-fit to create as many tracks as fit and minmax to give each track a preferred minimum while allowing it to grow. min(100%, 16rem) prevents that minimum from exceeding a narrow container. gap creates spacing between tracks. The available container width, not a device name, determines the number of columns. Browser support and the project’s fallback requirements should be checked for the target audience.
<section class="courses" aria-labelledby="courses-title">
<h2 id="courses-title">Courses</h2>
<div class="course-grid">
<article class="course-card"><h3>Foundations</h3><p>Start with the basics.</p></article>
<article class="course-card"><h3>Practice</h3><p>Apply the concepts.</p></article>
<article class="course-card"><h3>Review</h3><p>Check your understanding.</p></article>
</div>
</section>
Articles remain in source order and retain their headings without CSS.
Allow content to shrink and wrap
min-inline-size: 0 allows the card to shrink within its track, while overflow-wrap: anywhere gives long unbroken text an emergency wrap opportunity. This can affect word breaking, so apply it to content that needs it and inspect the result. Padding and borders consume space inside the card according to box sizing; a project-wide box-sizing policy should be consistent with the design.
.course-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
gap: 1rem;
}
.course-card {
min-inline-size: 0;
padding: 1rem;
border: 1px solid currentColor;
overflow-wrap: anywhere;
}
Tracks fit the container, and long content can wrap inside a shrinking card.
Maintain accessible presentation
Grid placement can change visual order without changing DOM reading and keyboard order. Keep the source order aligned with the intended reading sequence and avoid using visual reordering to conceal a mismatch. Check headings, color contrast, focus indicators on any interactive elements, and Arabic as well as English content. A responsive layout is successful only if the information remains usable, not merely if the page has no scrollbar.
Verify the layout
Combine the two blocks in a document and inspect wide, intermediate, and narrow container widths. Test a very long label, enlarged text, and both writing directions. Confirm cards do not clip essential content or force page-level horizontal scrolling, and use keyboard navigation if links are added. Check the computed track sizes when behavior differs from the expectation, and verify a reasonable fallback in supported browsers.
Model the content before the tracks
A card is a visual grouping, not an HTML element with automatic semantics. Choose markup from the content: a section with a heading can group related article elements, while a list may suit a collection whose items do not need independent article semantics. Headings identify each item and links or buttons appear only when there is a real destination or action. Put items in a meaningful source order that remains understandable when the grid becomes one column or CSS is unavailable.
The grid operates on generated in-flow child boxes. An ordinary direct child that generates a box participates as an item; display:none creates no box, display:contents suppresses the element’s own box, and direct non-whitespace text can create an anonymous item. Inspect the box tree if the visual grid has unexpected items. Do not use dense packing or manual placement to hide a source sequence that conflicts with the intended reading and keyboard order.
Count tracks from available space
For a definite inner width, repeated tracks and gaps must fit within the grid container. Suppose the minimum is 16rem and the gap is 1rem: two minimum tracks require 33rem, while three require 50rem. The actual track count depends on the complete sizing rules and constraints, but these sums make a useful model for a simple definite-size fixture. Gaps occur between adjacent tracks, so three columns have two column gaps, not three.
repeat(auto-fit, minmax(min(100%, 16rem), 1fr)) combines a capped minimum with flexible maximums. In a definite container narrower than 16rem, the inner min chooses the available width rather than demanding a 16rem track. As space increases, repeat can create more tracks. After placement, auto-fit collapses empty repeated tracks and associated gutters; auto-fill can retain them. The remaining nonempty tracks can grow, so an incomplete final collection need not leave visible empty columns.
Separate tracks, cards and content
A zero or capped track minimum is not a complete overflow policy. Track sizing controls the grid, item sizing controls each card box, and descendants have their own minimums and breaking behavior. min-inline-size:0 can permit an item to shrink where an automatic minimum would otherwise resist; overflow-wrap:anywhere creates emergency break opportunities for text where breaking is acceptable. An image, a nested flex item or an unbreakable code value may need a different treatment.
Padding and borders consume space too. With box-sizing:border-box, a specified width includes padding and border, but the content area is correspondingly smaller. For a 200px card with 16px padding on each side and 1px borders, 166px remains for content under that simple model. Avoid forcing a fixed card height for a translated title or error. If content must remain unbroken, provide an operable local overflow strategy or reconsider the component rather than hiding it.
Read the complete card fixture
The document below uses a labelled section, two articles and real fragment links in source order. The grid adds tracks as its available width permits; the min function caps the 16rem minimum for a narrower definite container. The article rule allows its item box to shrink and the paragraph rule permits the long identifier to break. border-box includes the padding and border in a specified card width, and the focus rule is separate from the track definition.
This fixture is intentionally unexecuted. The source supports a prediction, not a claim about a particular browser, keyboard, assistive technology or screen size. Inspect computed tracks at widths around a transition, then test the actual links, long strings and enlarged text. Check that each fragment destination exists, that focus is visible and that the English and Arabic versions retain a coherent sequence. A single screenshot or a missing page scrollbar cannot establish these outcomes.
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Workshop topics</title>
<style>
* { box-sizing:border-box; }
.cards { display:grid; gap:1rem; grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr)); }
.cards article { min-inline-size:0; padding:1rem; border:1px solid; }
.cards p { overflow-wrap:anywhere; }
a:focus-visible { outline:3px solid #174e9a; outline-offset:3px; }
</style>
<main><h1>Workshop topics</h1><section aria-labelledby="topics"><h2 id="topics">Topics</h2>
<div class="cards"><article><h3>HTML</h3><p>Structure and meaning.</p><a href="#html">HTML notes</a></article>
<article><h3>CSS</h3><p>averylongidentifierwithoutspaces0123456789</p><a href="#css">CSS notes</a></article></div></section>
<section id="html"><h2>HTML notes</h2><p>Use meaningful elements.</p></section>
<section id="css"><h2>CSS notes</h2><p>Adapt the presentation.</p></section></main>
The capped track minimum and wrapping rule address distinct layers while the source retains meaningful links.
Fallback and verification
Check the project’s supported browsers for the required Grid, min and auto-repeat features. A simple one-column base is a useful fallback; a feature query can apply the more advanced template when supported. A feature query alone does not prove that every combination behaves as expected in a specific browser, so test the actual supported versions and keep the content usable without the enhancement. Avoid inventing support claims from a specification.
Use a small matrix: empty collection, one card, several cards, a long unbroken identifier, larger text, right-to-left direction and keyboard interaction. Record the viewport and actual container width separately, since a card grid can live in a sidebar narrower than the viewport. Inspect the first overflowing box and computed track sizes before choosing a fix. Compare source and visual order, verify content is not clipped, and report only observations actually made.
20 worked examples
1. Two-track threshold
Problem: A definite 33rem grid has 16rem minimum tracks and a 1rem gap.
- Two minimum tracks and one gap total 16 + 1 + 16 = 33rem.
- Three minimum tracks require 50rem and therefore do not fit.
width=33rem; min=16rem; gap=1rem; items=2; no other constraints
Expected result: Two minimum tracks fit in this model.
Why this result follows: Track minima and the gap exactly fill 33rem.
2. Three-track threshold
Problem: A definite 50rem grid has three cards, 16rem minimum tracks and a 1rem gap.
- Three minima consume 48rem and two gaps consume 2rem.
- The resulting 50rem exactly fits the available inner width.
width=50rem; min=16rem; gap=1rem; items=3; no other constraints
Expected result: Three 16rem tracks fit under the model.
Why this result follows: Three tracks need two gaps between them.
3. Below the next threshold
Problem: A definite 49rem grid has three cards, 16rem minima and 1rem gaps.
- Three tracks would require 50rem including two gaps.
- Two tracks require 33rem and therefore fit in the simplified model.
width=49rem; min=16rem; gap=1rem; items=3; no other constraints
Expected result: The model forms two columns and a second row.
Why this result follows: The third minimum track cannot fit at 49rem.
4. Flexible remainder
Problem: A 40rem grid has two equal flexible tracks and a 1rem gap.
- The gap leaves 39rem for the tracks.
- Two equal fractions divide the remainder into 19.5rem each.
width=40rem; columns=repeat(2,minmax(0,1fr)); gap=1rem
Expected result: Each modeled track is 19.5rem.
Why this result follows: Equal fractions share the space left after the gap.
5. Auto-fit collapse
Problem: A 50rem grid could fit three 16rem tracks with 1rem gaps but has two cards.
- The automatic repeat can create three tracks under the stated dimensions.
- Auto-fit collapses the unused track and its gutter, leaving 49rem for two equal tracks.
width=50rem; repeat(auto-fit,minmax(16rem,1fr)); gap=1rem; items=2
Expected result: Each occupied track is 24.5rem in this model.
Why this result follows: Collapsing the empty track leaves one gap between occupied tracks.
6. Auto-fill retention
Problem: The same 50rem dimensions use auto-fill with two cards and three possible tracks.
- Auto-fill keeps the empty repeated track rather than collapsing it.
- After two 1rem gaps, the three equal tracks share 48rem.
width=50rem; repeat(auto-fill,minmax(16rem,1fr)); gap=1rem; items=2
Expected result: All three tracks remain 16rem in this model.
Why this result follows: The empty auto-fill track retains its share of the grid.
7. Container versus viewport
Problem: A 70rem viewport contains a 30rem sidebar grid.
- The grid track count depends on its available container width.
- Two 16rem tracks and their 1rem gap need 33rem, exceeding the sidebar.
viewport=70rem; grid inner width=30rem; min=16rem; gap=1rem
Expected result: The simple sidebar model cannot fit two minimum tracks.
Why this result follows: The component’s available width is not the viewport width.
8. Border-box budget
Problem: A 200px border-box card has 16px padding and 1px border on both inline sides.
- Padding totals 32px and borders total 2px.
- Subtracting 34px from 200px leaves 166px of content width.
.card { box-sizing:border-box; width:200px; padding-inline:16px; border:1px solid; }
Expected result: The modeled content width is 166px.
Why this result follows: Border-box includes padding and borders in the declared width.
9. Long token
Problem: A card contains an identifier without spaces that exceeds its content width.
- A token with no break opportunities can overflow its line.
- Where breaking is acceptable, anywhere introduces emergency opportunities.
.card p { overflow-wrap:anywhere; }
Expected result: The intended text policy permits the identifier to wrap.
Why this result follows: The text wrapping rule addresses the descendant rather than track count.
10. Wide image
Problem: An image inside a narrow card has an intrinsic width of 800px.
- The image can exceed the card if its size is not constrained.
- A maximum inline size and automatic block size can shrink it proportionally.
.card img { max-inline-size:100%; block-size:auto; }
Expected result: The intended image fits its available inline space without forced distortion.
Why this result follows: The image box needs its own sizing policy.
11. Nested flex minimum
Problem: A card contains a flex row with a fixed icon and long text.
- The text flex item may retain an automatic minimum.
- Allowing its inline minimum to shrink and wrapping its text addresses both layers.
.row { display:flex; } .text { min-inline-size:0; overflow-wrap:anywhere; }
Expected result: The intended text item can shrink and its token can wrap.
Why this result follows: The inner flex item has a constraint separate from the outer grid track.
12. Empty collection
Problem: A grid receives no articles from the application.
- The layout has no content items to display.
- It cannot supply the application’s empty-state message automatically.
cards=[]; template=repeat(auto-fit,minmax(min(100%,16rem),1fr))
Expected result: Provide an appropriate empty message if the task requires one.
Why this result follows: A track algorithm does not decide application content.
13. Source order
Problem: Three cards are listed A, B and C in document order.
- Ordinary auto-placement uses the available grid positions.
- Changing the number of columns does not itself change the DOM sequence.
source=[A,B,C]; grid-auto-flow=row; no manual placement
Expected result: The source sequence remains A, B, C.
Why this result follows: Grid presentation does not rewrite the document order.
14. Dense placement
Problem: A later card C fits an earlier hole before card B under dense packing.
- The dense algorithm can backfill an earlier vacant area.
- The document still lists B before C, creating a potential visual order mismatch.
source=[A,B,C]; grid-auto-flow:row dense; C fills an earlier hole
Expected result: Avoid dense packing if this sequence carries meaning.
Why this result follows: Visual packing does not alter DOM or ordinary focus order.
15. Semantic collection
Problem: Three independent workshop topics each have a heading and explanation.
- Each topic can be an article when it is independently meaningful.
- A labelled section groups the articles without requiring every card to be clickable.
<section aria-labelledby="topics"><h2 id="topics">Topics</h2><article><h3>HTML</h3><p>Structure.</p></article><article><h3>CSS</h3><p>Presentation.</p></article><article><h3>Access</h3><p>Inclusive use.</p></article></section>
Expected result: The section and article express the content relationship.
Why this result follows: The markup follows content meaning rather than visual appearance alone.
16. Card link focus
Problem: A card contains a link that receives keyboard focus.
- A focus-visible outline can identify the focused link.
- The card needs enough space and no clipping that hides the outline.
a:focus-visible { outline:3px solid #174e9a; outline-offset:3px; }
Expected result: The matching link receives an outline under the cascade.
Why this result follows: Focus visibility depends on both styling and surrounding layout.
17. RTL card padding
Problem: A horizontal RTL card uses padding-inline-start:1rem.
- Inline start maps to the right in this writing mode.
- The padding follows that edge rather than a fixed physical left.
.card { direction:rtl; padding-inline-start:1rem; }
Expected result: The padding is on the right under the stated conditions.
Why this result follows: Logical padding follows the inline direction.
18. One-column fallback
Problem: A card list starts as a normal block flow before a supported Grid enhancement.
- The base order remains the source order.
- A feature query can add the track template only when its declaration is supported.
.cards { display:block; } @supports (grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr))) { .cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr)); } }
Expected result: The intended fallback remains a single flow.
Why this result follows: The enhancement is conditional while content stays in the document.
19. Gap count
Problem: Four card columns use a 12px column gap.
- There are three spaces between four adjacent tracks.
- Three gaps of 12px occupy 36px before track widths are added.
columns=4; column-gap=12px; gaps=3
Expected result: The gaps consume 36px.
Why this result follows: Gaps occur between tracks, not after the last track.
20. Unrun card test
Problem: A card template was reviewed in source but not rendered in a browser.
- The CSS supports a prediction about the intended layout.
- No observation establishes clipping, keyboard focus or assistive-technology behavior.
browser render=not run; keyboard check=not run; actual track sizes=unknown
Expected result: Report those checks as pending.
Why this result follows: Source inspection is not a recorded interaction test.
Common errors and fixes
The grid overflows a narrow container
- Why it happens
- A fixed minimum track width exceeds available space.
- How to fix it
- Bound the minimum by the container width and test the fallback.
- Prevent it next time
- Test a container narrower than the preferred card width.
A long word forces a card wider
- Why it happens
- The item minimum or unbroken content prevents shrinking.
- How to fix it
- Allow the item to shrink and apply an appropriate wrapping policy.
- Prevent it next time
- Test long identifiers and localized labels.
Visual and keyboard order disagree
- Why it happens
- CSS reordered cards independently of the document.
- How to fix it
- Keep source and visual order aligned for the intended interaction.
- Prevent it next time
- Navigate the page by keyboard and inspect the accessibility tree.
20 practice exercises
1. What happens when only one 16rem card fits?
Show hint
Consider the capped minimum and remaining flexible space.
Show worked solution
The grid can use one column, with the card growing to the available track width. If the container is narrower than 16rem, the min() expression permits a smaller minimum rather than forcing 16rem.
When only one 16rem minimum track fits, the single occupied track can grow to the available width. If the definite container is narrower than 16rem, min(100%,16rem) caps the minimum at the available width rather than forcing 16rem; content still needs an overflow policy.
Check your solution
- One occupied track can grow within the available width.
- Below 16rem the capped minimum can shrink while content is checked separately.
2. Why is no scrollbar alone insufficient evidence of success?
Show hint
Look for hidden or inaccessible content as well as scrolling.
Show worked solution
Content might be clipped or reordered in a confusing way. Verify readability, source and focus order, and access to any controls at the tested widths and zoom levels.
A missing scrollbar may result from clipping, and visually reordered cards can conflict with source or focus order. Inspect the whole text, link access, focus indicator and sequence at the tested widths and zoom before reporting success.
Check your solution
- Essential text and controls are not clipped.
- Source, visual and focus sequences are checked.
3. Three 15rem minimum cards must fit a 50rem inner grid width. What is the largest equal gap between them under a no-extra-constraints model?
Show hint
Subtract the three minima, then divide the remainder by the two gaps.
Show worked solution
The cards need 45rem, leaving 5rem for two gaps. Each gap can be at most 2.5rem for the three minimum tracks to fit exactly. Borders, margins or other track constraints would need to be included in an actual calculation.
Check your solution
- Three track minima total 45rem.
- Two gaps of 2.5rem use the remaining 5rem.
4. Three cards share one grid row with grid-auto-rows:minmax(10rem,auto). Their required block sizes are 8rem, 12rem and 9rem. Model the row height.
Show hint
The row must accommodate its largest content contribution and minimum.
Show worked solution
Under the simplified assumptions, the row is 12rem because the largest card requires 12rem, above the 10rem minimum. Padding, borders and other constraints may alter a real result, so inspect the actual track in the target browser.
Check your solution
- The largest stated card requires 12rem.
- The modeled row is 12rem high.
5. A card grid has three 8rem rows and row-gap:1rem. Calculate the height of tracks and gaps without padding or borders.
Show hint
Three rows have two gaps between them.
Show worked solution
The rows total 24rem and two gaps add 2rem, producing 26rem. This is a model of specified track sizes; real content can increase rows when the sizing rules permit it.
Check your solution
- The two row gaps total 2rem.
- The modeled height is 26rem.
6. A collection of five brief product links has no independently meaningful articles. Choose semantic markup and explain how CSS Grid can style it.
Show hint
The card appearance does not require article elements.
Show worked solution
Use a list with five list items and a link in each item, then apply display:grid and the track template to the list. Preserve useful link names and a meaningful source order; visual cards do not need article semantics simply because they have borders.
Check your solution
- Five list items contain the five links.
- The grid changes presentation while list relationships remain.
7. A card image is decorative because the adjacent heading already conveys the topic. Choose its alt and explain what happens if the image later adds information.
Show hint
Consider the image’s role in context.
Show worked solution
Use alt="" while the image adds no information or function. If it later conveys a detail absent from the heading, write an alternative that communicates that detail and reassess the whole card so information is not lost or repeated.
Check your solution
- The decorative image has an empty alt.
- An informative replacement receives a meaningful alternative.
8. A vertical list of cards has one card per row; each card spans the same three parent columns. Align each card’s internal name, description and price fields to those columns. Explain subgrid and a fallback constraint.
Show hint
A parent grid of card boxes alone does not align internal fields.
Show worked solution
Set each card to display:grid, span all three parent columns, and use grid-template-columns:subgrid so its name, description and price occupy the inherited tracks. This assumes each card occupies a separate row. Test target-browser support and provide a separately designed fallback; independent nested grids do not automatically share the parent tracks.
Check your solution
- Each full-row card inherits the same three parent columns.
- The fallback is independently checked for alignment.
9. A card uses minmax(0,1fr), but a long URL still spills outside its track. Explain two separate repairs and when one is inappropriate.
Show hint
A track minimum does not itself create text break opportunities.
Show worked solution
Allow the relevant item to shrink if its own minimum is restrictive and apply overflow-wrap:anywhere to the URL when breaking is acceptable. If the value must stay unbroken, use an operable local scroll or another layout instead; inspect the first oversized box before choosing.
Check your solution
- Track or item sizing and text policy are inspected separately.
- An unbreakable-value requirement is preserved by the chosen policy.
10. A code sample in a 240px card must preserve exact line breaks and cannot wrap. Design a local overflow policy and an interaction check.
Show hint
The content’s integrity may require local scrolling.
Show worked solution
Put the code in a locally scrollable region rather than clipping it or forcing page-level overflow. Provide a discoverable, keyboard-operable region where necessary and test that the entire sample can be reached at 240px and zoom in the supported environment.
Check your solution
- The code retains its original line breaks.
- The full sample is reachable in the target keyboard test.
11. A grid has three ordinary article children, but the middle article is display:none. How many article boxes participate, and what should be checked?
Show hint
Grid items are generated boxes, not simply DOM element counts.
Show worked solution
The middle article generates no box, so the first and third article boxes participate under the stated ordinary conditions. Verify that hiding the middle content is intentional and that it does not contain an essential action or information needed by the task.
Check your solution
- Two article boxes participate.
- The hidden content is reviewed for essential information or actions.
12. A card wraps a heading link and a second “Read more” link to the same destination. Propose a clearer keyboard interaction.
Show hint
Avoid redundant focus stops when they perform the same action.
Show worked solution
Use one descriptive link such as the topic heading, and remove or make the redundant text noninteractive when it adds no distinct action. Check the resulting focus sequence and link name with the actual content, retaining separate controls only when they have different purposes.
Check your solution
- The card has one clear link for the single destination.
- Keyboard navigation and the link name are checked.
13. A card list source is C, B, A but manual grid placement displays A, B, C. Repair the mismatch when that sequence is meaningful.
Show hint
Correct the meaningful document sequence first.
Show worked solution
Place the items in A, B, C source order and remove the placement rules that reverse them unless a separate requirement justifies them. Test both the visible and keyboard sequence at one and multiple columns, since CSS placement does not reorder the document.
Check your solution
- Source order is A, B, C.
- Visual and keyboard sequences are compared in both layouts.
14. A grid container has two article elements and a direct text node “Featured”. Explain the extra item and a structural repair.
Show hint
Non-whitespace text can form an anonymous grid item.
Show worked solution
The direct text can be wrapped in an anonymous grid item in addition to the two article boxes. Move “Featured” into an appropriate heading or labelled content element outside the card grid, then inspect the generated boxes and intended source sequence.
Check your solution
- The direct non-whitespace text can create an additional item.
- The label is moved into meaningful markup.
15. A card link needs a visible focus style in browsers with and without :focus-visible support. Design a fallback.
Show hint
Retain a baseline focus treatment before adding an optional refinement.
Show worked solution
Provide a visible :focus outline as the baseline, and refine it with :focus-visible where supported without removing the only usable indicator. Test Tab navigation, clipping and contrast on actual cards in the supported browser matrix.
Check your solution
- The baseline keeps a visible focus indicator.
- The target tests cover keyboard focus and clipping.
16. A card link’s focus outline is clipped by overflow:hidden on the card. Design a repair and an observable check.
Show hint
The outline can extend outside the element boundary.
Show worked solution
Remove unnecessary clipping or reserve space for a visible focus indicator within the card. Tab through the links at narrow width and enlarged text, recording whether the full outline is visible and whether the focused link remains unobscured.
Check your solution
- The focused link retains a visible indicator.
- The target keyboard test checks the actual rendered outline.
17. An English card heading is one line but its Arabic translation needs three and contains combining marks. Design a resilient card rule and test.
Show hint
Avoid fixing height to the original font metrics.
Show worked solution
Let the heading and card have content-sized block dimensions, use a suitable line-height and allow the grid row to grow. Test the actual Arabic string, fallback fonts and enlarged text for clipped marks or overlap with the next card; a fixed height based on English is insufficient.
Check your solution
- The card can grow for three lines.
- Arabic marks and enlarged text are inspected for clipping.
18. Three card tracks each need 12rem inside a 40rem grid. Compare a 2rem gap with a 3rem gap under fixed minimum assumptions.
Show hint
Three tracks have two gaps.
Show worked solution
With 2rem gaps the total is 36 + 4 = 40rem, so three fit exactly. With 3rem gaps the total is 36 + 6 = 42rem, so three minimum tracks cannot fit. Actual padding and sizing constraints must be checked separately.
Check your solution
- Three tracks fit with 2rem gaps in the model.
- Three tracks need 42rem with 3rem gaps.
19. A card collection is understandable with CSS enabled. Define a concrete style-free check for its headings, links and sequence.
Show hint
Disable presentation while retaining the document content.
Show worked solution
Read the source-rendered collection with CSS disabled or overridden, checking that the section heading, each card heading and link name remain understandable in their meaningful order. Restore styles and compare visual and keyboard order; no styling should be required to reveal essential text.
Check your solution
- The section and card headings remain understandable without CSS.
- Link names and source order are compared with the styled layout.
20. A grid has five cards, a long URL and one actionable link per card. Design a verification matrix across narrow, RTL and zoom conditions.
Show hint
Vary content, direction and interaction while recording the actual environment.
Show worked solution
Test a narrow container with the full URL, an RTL translation with all five links, and enlarged text while tabbing through the links. Record browser, container width, zoom, overflow and focus observations; check that no essential content is clipped and the visual sequence remains coherent.
Check your solution
- The matrix includes narrow content, RTL and enlarged text.
- Actual overflow, focus and order observations are recorded.
Key takeaways
- Let available space and content determine the grid.
- Verify wrapping, source order, and usability at narrow widths.
- Track sizing, item minimums and content wrapping are separate constraints.
- A meaningful source order remains necessary across visual layouts.
- A missing scrollbar is not proof that content and focus are accessible.