I would like to visually hide the <h1>
element on the page from regular site visitors; however, I am conscious that the element is important for users with screen readers. So I need to visually hide the element in a way that screen readers can still access it.
It seems there are many techniques which could be used. For example using text indenting to move the text off the screen. In other case some use styling, to set the height and width of to 1px and then hide the overflow.
While these should work from an accessibility point of view, I am concerned that these techniques could be considered as a case of "cloaking" by search engines, resulting in the site being penalized.
What would be the best way of solving this? Is this even possible?
aria-label
works only on interactive (a, button, input, ...) and landmark (h1, h2, ..., section, main, nav, ...) elements. – Kynewulf