Re:10 Weird HTML Hacks That Shaped the Internet
by davidy123 on Friday December 01, 2023 @07:26AM
(#38485949)
This doesn't include my "favourite," putting a heading for accessibility at a -10000 position, so screen readers would read it, but it didn't render on the screen.
[ Parent
| on HN ]
Re:10 Weird HTML Hacks That Shaped the Internet
by bonzini on Friday December 01, 2023 @09:45AM
(#38487238)
Does it still work? Or do you have to use ARIA?
Re:10 Weird HTML Hacks That Shaped the Internet
by arcanemachiner on Friday December 01, 2023 @12:50PM
(#38489763)
I think you can use `visibility: hidden` or something like that.
Re:10 Weird HTML Hacks That Shaped the Internet
by robertc on Friday December 01, 2023 @03:21PM
(#38491794)
Most screen readers ignore hidden elements IIRC.
Re:10 Weird HTML Hacks That Shaped the Internet
by jorgesborges on Friday December 01, 2023 @12:38PM
(#38489552)
This still works and is a somewhat common practice, especially for something like a skip link. Try pressing tab on some of your favorite websites you might find they use this technique.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#...
Re:10 Weird HTML Hacks That Shaped the Internet
by davidy123 on Friday December 01, 2023 @11:02AM
(#38488234)
I don't see why it wouldn't work, but the right thing to do is use accessibility features.
Re:10 Weird HTML Hacks That Shaped the Internet
by zerocrates on Friday December 01, 2023 @03:11PM
(#38491649)
This (as well as close relatives of this) is still relatively common because we still don't have a great option for to have non-visible text that's screen-reader accessible in all cases.
aria-label and things like that have replaced some usages of this pattern but not all.