Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples on CSS Anchor pages do not work in Firefox 135.0 on Mac OS Ventura #38129

Closed
dyoung404 opened this issue Feb 12, 2025 · 1 comment
Closed
Labels
closed: question A user misinterpretation or support question. No action required. Content:CSS Cascading Style Sheets docs

Comments

@dyoung404
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_anchor_positioning/Using

What specific section or headline is this issue about?

Anchoring infobox to anchor while scrolling

What information was incorrect, unhelpful, or incomplete?

It appears that the CSS used to provide the examples on this page do not work in Firefox 135.0 on Mac OS Ventura.

<p>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
  incididunt ut labore et dolore magna aliqua. Dui nunc mattis enim ut tellus
  elementum sagittis vitae et.
</p>

<div class="anchor">⚓︎</div>

<div class="infobox">
  <p>This is an information box.</p>
</div>

<p>
  Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. In arcu
  cursus euismod quis viverra nibh cras pulvinar. Vulputate ut pharetra sit amet
  aliquam.
</p>

<p>
  Malesuada nunc vel risus commodo viverra maecenas accumsan lacus. Vel elit
  scelerisque mauris pellentesque pulvinar pellentesque habitant morbi
  tristique. Porta lorem mollis aliquam ut porttitor. Turpis cursus in hac
  habitasse platea dictumst quisque. Dolor sit amet consectetur adipiscing elit.
  Ornare lectus sit amet est placerat. Nulla aliquet porttitor lacus luctus
  accumsan.
</p>
.anchor {
  font-size: 1.8rem;
  color: white;
  text-shadow: 1px 1px 1px black;
  background-color: hsl(240 100% 75%);
  width: fit-content;
  border-radius: 10px;
  border: 1px solid black;
  padding: 3px;
}

body {
  width: 50%;
  margin: 0 auto;
}

.anchor {
  anchor-name: --myAnchor;
}

.infobox {
  color: darkblue;
  background-color: azure;
  border: 1px solid #ddd;
  padding: 10px;
  border-radius: 10px;
  font-size: 1rem;
}

.infobox {
  position-anchor: --myAnchor;
  position: fixed;
  inset-block-start: anchor(end);
  inset-inline-start: anchor(self-end);
  margin: 5px 0 0 5px;
}

What did you expect to see?

I would expect that, when I scroll the div, the infobox should maintain it's positioning relative to the anchor -- meaning it should scroll with the anchor element. It somewhat works in Chrome 130.0.x. The infobox scrolls w/ the anchor when the viewport is scrolled, but it's initial positioning doesn't align to the left edge of the anchor element like it does in Firefox.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@dyoung404 dyoung404 added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Feb 12, 2025
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Feb 12, 2025
@Josh-Cena
Copy link
Member

Firefox does not support anchor positioning. See https://developer.mozilla.org/en-US/docs/Web/CSS/position-anchor

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2025
@Josh-Cena Josh-Cena added closed: question A user misinterpretation or support question. No action required. and removed needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. labels Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: question A user misinterpretation or support question. No action required. Content:CSS Cascading Style Sheets docs
Projects
None yet
Development

No branches or pull requests

2 participants