Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>Sort of Possible, But Still Not Sure You Would Want To</h2> <p><strong>And poses some serious challenges which varies depending on the context.</strong></p> <p>One problem is that your stated goal is to reduce html clutter and redundancy. However, to have a link, you still need to have an anchor element (<code>&lt;a&gt;&lt;/a&gt;</code>) as the root for the link. </p> <p>Nevertheless, <strong>one way</strong> you could do something like that with today's browsers (now that pseudo-elements are more generally supported) is to divorce the text from the <code>a</code> which leaves an <em>empty</em> anchor in your code. So you still have the HTML <code>a</code> in the code, but eliminates any redundant <em>text</em>. How useful really is that? Not very is my thought. Especially if you are dealing at all with <em>inline</em> links that <em>are part of the text</em>, because what you would do is then add text to those links via the pseudo-element, something like:</p> <pre><code>a[href='#oneUrl']:before { content: 'your anchor text'; } </code></pre> <p>Look at <a href="http://jsfiddle.net/hSNLr/8/">this fiddle example</a>. </p> <p>However, there is <strong>another way <em>that reduces HTML further</em></strong>, but has some other severe limitations. You could have links in the text itself (let's say), which allows for relevant real content wording in those. However, each of those can have two (<em>max</em> at present) pseudo-elements associated that could "extend" to be separate links in headers, footers, etc. Look at <a href="http://jsfiddle.net/hSNLr/15/">this fiddle example</a>. Obviously, this requires you to be able to precisely locate those links (perhaps using <code>position: fixed</code> as the example has), which can be challenging. A big issue, however, is that search engines are not going to pick up those extra links or their text, and screen readers are not either, so your "main navigation" actually becomes <em>invisible</em> to some extent. That would seem to be undesirable to me, but <em>it does indeed limit your html redundancy</em>. </p>
 

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