HTML Popovers

HTML Living Standard

Use a popover for optional information the user can glance at while continuing to use the page.

On this page

Open and dismiss an auto popover

Add popover to the element you want to show above the page. Match the button’s popovertarget to that element’s id. The browser keeps the popover hidden at first and toggles it when the button is activated. With the default auto behavior, clicking outside or pressing Escape also closes it. The rest of the page remains interactive.

How to try it In index.html, replace the content between <body> and </body> with this example. Save the file and reload it in the browser.

<button type="button" popovertarget="sku-help">What is a SKU?</button>
<p id="sku-help" popover>A SKU is a code that identifies a product.</p>

What to expect Activate the button to show the explanation. Click outside or press Escape to dismiss it.

Give a news page structure

Build a news page with a header, navigation, main story and related information. Use article for a story that could stand alone and aside for the related links. Check the accessibility tree in DevTools to see how the main region is exposed.

Official references