Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If the link is an "enhanced" link, that will do pretty much the same that the usual link would do but in a more "user-friendly" way – such as a navigation link, that, when JavaScript is enabled on the page, will reload only the "content" part of the page and update the address of the page with <a href="http://diveintohtml5.info/history.html" rel="nofollow">HTML5 History API</a> – then I would just use a semantic class, actually describing the links, such as "navigation".</p> <p>In case they are JavaScript triggers and they wouldn't be functioning when JavaScript is off – I would suggest not using the <code>a</code> element at all. From the <a href="http://www.w3.org/TR/html5-author/the-a-element.html" rel="nofollow">spec</a>:</p> <blockquote> <p>If the <code>a</code> element has an <code>href</code> attribute, then it represents a hyperlink (a hypertext anchor). If the <code>a</code> element has no <code>href</code> attribute, then the element represents a placeholder for where a link might otherwise have been placed, if it had been relevant.</p> </blockquote> <p>I believe that in most cases "action triggers" aren't really fitting the description of the use of an <code>a</code> element. Therefore, I would suggest using a <code>span</code> element, that would be styled in a way that would suggest that it's a trigger for interaction. Quoting the <a href="http://developers.whatwg.org/text-level-semantics.html#the-span-element" rel="nofollow">spec</a> again: </p> <blockquote> <p>The <code>span</code> element doesn't mean anything on its own, but can be useful when used together with the global attributes, e.g. <code>class</code>, <code>lang</code>, or <code>dir</code>. It represents its children.</p> </blockquote> <p>Another suggestion regarding these triggers: use this line of code (the very first thing after the <code>&lt;title&gt;</code> in the head of your document) in order to give your <code>html</code> element a class <code>js</code>:</p> <pre><code>&lt;script&gt;document.documentElement.className = 'js';&lt;/script&gt; </code></pre> <p>Then in your CSS do this:</p> <pre><code>/* assuming that this is your mark-up for the pseudo-links: &lt;span class="action-trigger"&gt;Beautiful transition&lt;/span&gt; */ .action-trigger { display:none; visibility:hidden; } .js .action-trigger { display:inline;/* or whatever suits your styling of these elements */ visibility:visible; } </code></pre> <p>This way, when JavaScript is disabled, users won't see "pseudo-links" that would be calling for action, but wouldn't actually work.</p> <p>UPD. Semantically, in certain cases, you could also use form submit elements, such as <code>&lt;button&gt;</code>: as an example – you may trigger form submission – all the "voting"/"liking"/"deleting" functionality falls into this category. Which, when JS is disabled would really submit that form, but when JS is enabled that would trigger an action on the side of your back-end API.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload