<html><body>
<details open><summary>This is the summary</summary>
<a name="a1"></a>
<p>Here are all the details.</p>
</details>
<p>Imagine more than a page of text here.</p>
<p><a href="#a1">This</a> is a link pointing inside the details.</p>
</body></html>
I'm opening my above HTML code with the Firefox browser. When I click on the "This" link Firefox correctly scrolls to the page to the details.
However, when I click the triangle left to the title "This is the summary", and the details (including the line with the anchor) get closed (disappear), clicking on the link Firefox does not scroll to the anchor any more.
I would have expected Firefox at least to scroll to the visible summary that hides the anchor even when the details are closed, but ideally also to open up the details and scroll exactly to the anchor.
Is there a way (HTML? css? using which browser? other?) that enables scrolling to anchors in closed (folded) details of the details-summary block?
My question is related to Scroll to anchor when expanding details/summary?, but I would prefer a javascript-free solution if one exists.
To test your solution please substitute the "more than a page of text here" with actually more than one page of text.