4 ms·
Element names are not designed to be hooks for CSS and JS - they are designed to have meaning, to create a semantic web. This can't be achieved with arbitrary n
by tagawa 15y ago
Element names are not designed to be hooks for CSS and JS - they are designed to have meaning, to create a semantic web. This can't be achieved with arbitrary names.
For example, pre-HTML5 sites often use a variety of <div id="head">, <div id="heading">, <div id="header">, etc. If each website is a separate entity that's fine, but if we have a longer term goal of creating some kind of global project - a programmable, mashable, indexable web - it's easier with a pre-agreed vocabulary.
I agree there may be a better way to do it and tag names could be taken to far, but with iterative development we'll get something that works and can be used by everyone (which is better than a perfect solution that never leaves the drawing board), IMO.
- rfugger 15y agoTrying to aim a standard at an amorphous, undefined future goal doesn't seem very likely to succeed.
- ugh 15y agoOk, then. Let’s not talk about future goals, talk about current benefits. Headline tags allow the visually impaired to efficiently navigate webpages. Their screenreader doesn’t have to read everything, they can jump from headline to headline in order to get an overview. This wouldn’t work so great if every website used different headline tags.
- andybak 15y agoIs there actually a shipping user agent, screen reader or otherwise, that behaves this way? I could be wrong but I don't recall that they were ever particularly quick to make use of all the new markup we try and provide for them. It reminds me of the battles about CSS vs Tables for layout where screen readers were always wheeled out as an argument for not using tables. Expect that all the shipping screen readers seemed to cope fairly well with tables. (There are many ways in which your markup can break screen-readers but the issues are often more subtle and complex than 'use this tag or that tag' and require someone to actually test in a specific screen reader)
- ugh 15y agoThe iOS and OS X screenreader VoiceOver, for example. (JAWS, too, of course.) It’s pretty cool actually: You can rotate with two fingers to switch between different ways of navigating the page: headline to headline, link to link, container to container, line to line and so on. I suggest you try it out when you have the chance. (If you want you can test out HN to see how the experience here could be significantly improved if headline tags were used correctly.) Here is a short video if you can’t try yourself: http://www.youtube.com/watch?v=rxlxx6RXbs8 http://www.youtube.com/watch?v=rxlxx6RXbs8 Do you really think accessibility advocates were asking everyone to correctly use headline tags for fun?