1. 17
    1. 3

      This sounds like a cool technique. Unless I’m missing something, though, the author never updated their stylesheet to incorporate the new features they describe, right?

      1. 4

        That was the impression I got. I read the post as basically saying “here’s how I would rewrite REVENGE.CSS using modern CSS.” I imagine this wouldn’t be too much work, although there are some pretty gnarly-looking selectors in the existing stylesheet that would probably take a bit to wrap your head around.

      2. 2

        I like this article a lot, but…what’s the objection to anchor tags without href?

        1. 2

          From my reading, it was that if an anchor tag doesn’t have an href, then it must be being used to trigger some JavaScript action, and that the proper element for that is a button. (I don’t have an opinion on whether this is actually correct or not.)

          Edit: This would seem to forbid the (IME fairly common) practice of creating an “anchor point” with <a id="some-section-name"></a>. I suppose the author thinks that IDs should be applied to elements like headers instead? In the event that a page layout changes, and multiple anchors start pointing to the same logical element, I’m not sure how you could handle that in a backward-compatible way… each element can have only one ID.

          1. 3

            Anchor tags without an href establish document anchors, though, and can be linked to by other anchor tags. It adds a #value to the URL. It’s very useful and semantic, and helpful for accessibility.

            1. 4

              AFAICT this is deprecated, as it doesn’t appear in the latest HTML spec, and the id attribute (i.e. on a section or heading) should be used instead for creating navigable fragments.

              I’m guessing that navigating to a URL and automatically being focused on an empty, useless element was an accessibility issue.

              However, the spec also gives an example where <a> without href would be appropriate:

              If a site uses a consistent navigation toolbar on every page, then the link that would normally link to the page itself could be marked up using an a element:

              <nav>
               <ul>
                <li> <a href="/">Home</a> </li>
                <li> <a href="/news">News</a> </li>
                <li> <a>Examples</a> </li>
                <li> <a href="/legal">Legal</a> </li>
               </ul>
              </nav>
              

              https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element

              but then, I would prefer to keep Examples as a live link with aria-current=page.

              1. 6

                Wow. When I first learned HTML the way to create a target anchor was <a name="frag">, but (unless I have missed something) HTML5 no longer lists name as a meaningful attribute.

                1. 4

                  I believe browsers still treat that as a targetable attribute when used as a URL fragment. See MDN – deprecated, but still there.

                  1. 3

                    Ah, I see it’s in the obsolete features section alongside <marquee> and other such classics.

      🇬🇧 The UK geoblock is lifted, hopefully permanently.