News for hackers. Stuff that matters.
Re:Annoying website features I face as a blind person by brainless on Thursday September 10, 2020 @02:44AM (#24429573)
Some CSS libraries suggest not using HTML semantics and just use CSS. So H1 isn't used, rather SPAN with corresponding CSS to make it look like an H1.

I guess this makes things hard for a screen reader since HTML isn't saying what's what anymore.

Re:Annoying website features I face as a blind person by Grumbledour on Thursday September 10, 2020 @02:59AM (#24429653)
After over a decade of discussion about the semantic web and accessibility, after so many best practices and recommendations from experts, it breaks my heart that in 2020 we are back to that.
Re:Annoying website features I face as a blind person by enriquto on Thursday September 10, 2020 @02:45AM (#24429577)
Is there a "rationale" for this sort of thing? It seems quite silly to do that, on a first look.
Re:Annoying website features I face as a blind person by rimliu on Thursday September 10, 2020 @02:53AM (#24429620)
Too lazy to learn is one of the reasons. Should use framework/lib is the other. Now people think that by not using frameworks you will have messy code and happily create even bigger mess of frameworks rope spaghetti.
Re:Annoying website features I face as a blind person by enriquto on Thursday September 10, 2020 @03:47AM (#24429897)
Ah, "frameworks rope spaghetti", the best kind of spaghetti!
Re:Annoying website features I face as a blind person by nargek on Thursday September 10, 2020 @02:49AM (#24429597)
At the end it looks the "same" for a normal user. Semantics in html is butchered a lot (remember the alignment with tabs ?)
Re:Annoying website features I face as a blind person by jtxx on Thursday September 10, 2020 @02:54AM (#24429627)
I only use spans and divs. header, paragraph, etc elements have intrinsic styles I rarely want, esp wrt margins
Re:Annoying website features I face as a blind person by the_other on Thursday September 10, 2020 @03:28AM (#24429815)
You need a “style sized solution to a style sized problem”. As the sibling posters have said, you can use reset stylesheets, or write your own.

At a deeper level, you have to appreciate that browsers are built around the “separation of concerns”:

- html for content

- css for layout, look and feel

- javascript for behaviour

The front-end community has some loud voices at the moment telling us that these are the wrong separations; that the styles for a component go hand-in-hand with their behaviour and semantics. I’m not getting into that debate here. But I do want to say that this newer interpretation of the “concerns” applies to code you write for your application, and is (currently) not how browsers are constructed. It may make more sense for you as a web application developer to structure your code by colocating your layout and behaviour solutions in one file, and in that way you’re more likely to use <div> and <span> over more expressive elements. But that’s not what your users’ browsers are expecting you to do. They’re built around the older separation of concerns. And they’re built to amplify the strengths of the three languages they interpret. So that <div> tells the browser “i want you to treat this content just the same as you treat any other content”, where a <h1> tells the browser “add this content to your document outline, expose it as a section heading to the accessibility tree” as well as reminding it to apply the default styles.

Attack the problem (unwanted styles) at the right level of separation (at the styles level).

Re:Annoying website features I face as a blind person by nlightcho on Thursday September 10, 2020 @03:06AM (#24429696)
You should use a CSS reset stylesheet like https://github.com/necolas/normalize.css instead.
Re:Annoying website features I face as a blind person by onion2k on Thursday September 10, 2020 @03:07AM (#24429703)
Eric Meyer wrote a good CSS reset more than 10 years ago. He made an updated version 8 years ago. https://meyerweb.com/eric/tools/css/reset/
Re:Annoying website features I face as a blind person by 9HZZRfNlpR on Thursday September 10, 2020 @07:59AM (#24431431)
CSS reset concept is over 10 years old? I don't see what's the point.
Re:Annoying website features I face as a blind person by the_other on Thursday September 10, 2020 @03:12AM (#24429738)
Don’t use those frameworks: they are not fit for purpose.
Re:Annoying website features I face as a blind person by XCSme on Thursday September 10, 2020 @09:10AM (#24431976)
Any examples of such libraries? I always heard that it's only better to use more specific tags if they are available and make semantic sense.