4 ms·
> Outside of accessibility, semantic HTML isn't worth thinking a lot about. There is no 'outside of accessibility' - or shouldn't be.
by squidbeak 4y ago
> Outside of accessibility, semantic HTML isn't worth thinking a lot about.
There is no 'outside of accessibility' - or shouldn't be.
- ravenstine 4y agoYou mean people don't read webpages without a screen-reader? There's no such thing as Reader mode? Web developers don't read HTML and want to write it in an organized way? Sure, there should be nothing outside of accessibility. /s If you read the post (and I can't really blame you for not reading it all the way through), you'd see that the author is suggesting that there are reasons besides supporting accessibility features for using these semantic HTML tags. I just don't agree that they are objectively good reasons for why one "should" do so. Oh yeah, and semantic HTML is by no means the only way to write pages that are accessible. Everything that a semantic tag can do, the role attribute can do, too. I never said to not care about accessibility.
- bXVsbGVy 4y agoThere is also portability. If you use main, article, etc is easier to write apps to process the page. Firefox reader mode use the main element to know how get the text from the page.
- extra88 4y ago> Everything that a semantic tag can do, the role attribute can do, too. <button> does far more than <div role=button> can do. Even if you meant to only refer to landmark roles, why write <div role=main> or <div role=region> when you can write <main> and <section>? As someone else pointed out, Reader modes don’t recognize roles and user stylesheets don’t either.
- chiefalchemist 4y agoAmen! I would give you a 1,000 of my HN karma points if I could.
- marginalia_nu 4y agoThat's kind of ridiculous. If it actually was true, that accessibility is not only an important concern when designing a website, but the singular overriding concern, then surely all websites ought to consist of a blank page with code like <html/> That's the most accessible website in the world. You can print it without paper, character encoding is no issue, RTL is no issue, you can see it when you are blind, you can listen to it spoken without connecting your headphones, even if you are deaf you can hear it spoken, it's printed in braille on the screen (or any flat surface), it works in all languages spoken and written and sign language. It really is the pinnacle of accessibility. It's even available in dead languages such as Linear A and Etruscan. Every website with any sort of content is strictly less accessible than this website (which also is as utterly useless as it is accessible).
- chrismorgan 4y agoJust to take a ridiculous idea seriously, because it’s fun⸺ The minimal “valid” HTML page is actually this: <!DOCTYPE html> … though it’s only valid in contexts that don’t require an in-document title, such as email text/html parts (the Subject header from the MIME message is used) or frames (no title is needed); for a top-level page in a web browser, to be “valid” it needs a non-empty title, such as <!DOCTYPE html><title>x</title> In both of these, the <html> open and close tag are omitted, as they’re both optional in HTML syntax. If you’re not caring about validity or quirks mode, then you might as well just serve a zero-byte text/html body. As for XML syntax which you seem to have tried to use, <html/> wouldn’t be a valid HTML document because you haven’t used the http://www.w3.org/1999/xhtml http://www.w3.org/1999/xhtml namespace.
- marginalia_nu 4y agoEh, my example renders perfectly well in every browser.
- xigoi 4y agoSo does a completely empty file.