FL
I'm not sure about the accessibility part, I'm pretty sure instead display: none will remove the element from the screen but from screen readers and keyboard navigation flows too, to make elements invisible on the screen but present for screen readers, some sort of visually-hidden CSS class, like the one in the orange link here: https://a11y-guidelines.orange.com/en/articles/accessible-hiding/ Other sources: https://webaim.org/techniques/css/invisiblecontent/#techniques
CommentArticleSep 6, 2023Choosing Between “display: none” and “visibility: hidden” in CSS: A Practical Guide