Your cancel-reservation dialog from the exercise now gives Mei Lin a second chance. Kwame’s next stop is the step ladder’s own page, where two kinds of text get in the way. The answers to its “?” buttons are always on show, and so is “Reservation saved”, even before Tomasz Nowak has reserved anything.
In this lesson, you’ll turn the help text into popovers that close once you’re done with them and the notice into one that stays until it’s closed. You’ll learn to predict which popovers are open, which is drawn on top, and where Tab goes next. Start with the help under Condition, which you need to see only if you ask for it.
Turn the Help Text Into a Popover
Everyone has to read past help text that never hides. Open step-ladder.html from this lesson’s starting site in your live preview. The “?” next to Condition does nothing, and its answer sits right under it.
In the cancel dialog’s fallback, you met the popover attribute, which keeps an element hidden until something shows it. A button’s popovertarget holds that element’s id, and each click shows or hides it. Replace the Condition paragraph and the one after it with this:
<p>Condition: Good
<button type="button" class="help-button"
aria-label="About condition"
popovertarget="condition-help">?</button></p>
<p id="condition-help" class="help-tip" popover>
Good means it works fully, with a few paint marks.</p>
The tip needs a border and background so it reads as a panel above the page. Add this rule at the end of styles.css:
.help-tip {
max-inline-size: 22rem;
padding: var(--space-m);
border: 2px solid var(--color-border);
border-radius: 0.25rem;
color: var(--color-text);
background: var(--color-surface);
}
Save and click the “?” next to Condition:

The tip opens in the middle of the window, far from its button. The browser’s own styles give an open popover position: fixed, inset: 0, and margin: auto, so it centers itself like the cancel dialog. Placing it beside its button takes anchor positioning, which the course’s next section covers.
A bare popover attribute means popover="auto", an auto popover. It closes by light dismiss, when you press Esc or click anywhere outside it.
An open popover goes into the top layer, the layer that held the modal cancel dialog, drawn above the whole page. Add margin-block-start: 0; to .help-tip and open the tip again. It now covers the sticky green header, even though the header has z-index: 100. Remove the line afterwards.