---
title: "Better defaults for popovers"
url: https://daily.dev/posts/better-defaults-for-popovers-htyqiensn
source_url: https://www.matuzo.at/blog/2026/better-defaults-for-popovers
type: article
source: "Manuel Matuzović"
published: 2026-06-22T14:41:56.398Z
updated: 2026-06-22T14:44:09.280Z
tags: ["css"]
reading_time: 2
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Better defaults for popovers

**[Manuel Matuzović](https://daily.dev/sources/matuzo)** · 2 min read · 0 upvotes · 0 comments

## Summary

A practical tip for improving popover default styling using CSS anchor positioning. By wrapping a small rule in a @supports feature query, popovers can be aligned to their triggering button instead of centering in the viewport. The snippet resets the margin and uses position-area with position-try-fallbacks to handle viewport overflow and RTL layouts, with the feature query ensuring Safari (which lacks anchor positioning support) is unaffected.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.matuzo.at/blog/2026/better-defaults-for-popovers>

## Similar posts on daily.dev

- [Popover Context Menus with Anchor Positioning – Frontend Masters Blog](https://daily.dev/posts/popover-context-menus-with-anchor-positioning-frontend-masters-blog-hwayozyfy) · Frontend Masters · 1 upvotes · 0 comments
- [Getting Started With The Popover API — Smashing Magazine](https://daily.dev/posts/getting-started-with-the-popover-api-smashing-magazine-vjbltzl0j) · Smashing Magazine · 47 upvotes · 2 comments

---

Tags: [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/better-defaults-for-popovers-htyqiensn)
