Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h1>Multiple tabs to the same link?</h1>

<h2>Examples cards</h2>

<ul>
  
    <li>
      <img src="https://rianrietveld.com/wp-content/uploads/sites/2/2019/04/home-flowers.jpg" alt="flowers">
      <h3><a href="#">Use only one link</a></h3>
      <p>The basis: only one link, inside the heading, that is clickable. The rest is not linked and also not clickable.</p> 
  </li>
  
  

  <li class="card">
    <a href="#">
      <img src="https://rianrietveld.com/wp-content/uploads/sites/2/2019/04/home-flowers.jpg" alt="flowers">
      <h3>Bad: Put an &lt;a&gt; around everything</h3>
      <p>This will result in very long, link texts and a pain to listen to if you use a screen reader.</p>
    </a>  
  </li>
  
  
  
  <li class="to-be-covered card">
    <img src="https://rianrietveld.com/wp-content/uploads/sites/2/2019/04/home-flowers.jpg" alt="flowers">
    <h3>
      <a href="#">Option: use a span to cover the card.
        <span></span>
      </a>
    </h3>
    <p>Have one link inside the card to the post. Add a span inside the link so it covers the complete card. Props: Janita Top.</p>
  </li>
  
  
  
  <li class="to-be-covered pseudo card">
    <img src="https://rianrietveld.com/wp-content/uploads/sites/2/2019/04/home-flowers.jpg" alt="flowers">
    <h3><a href="#">Option: using pseudo-content</a></h3>
    <p>Give the card container element position: relative;</p>
    <p>Give the link a ::after pseudo-content. Props: Heydon Pickering in Inclusive Components.</p>
  </li>
  
  
    
<li class="to-be-covered pseudo card">
  <img src="https://rianrietveld.com/wp-content/uploads/sites/2/2019/04/home-flowers.jpg" alt="flowers">
  <h3><a href="#">Option: using pseudo-content, plus extra link</a></h3>
  <p><a href="https://level-level.com">Extra link</a>: give it a positive z-index and position relative.</p>
  </li>

  
  <li class="card">
    <a href="#" tabindex="-1" aria-hidden="true"><img src="https://rianrietveld.com/wp-content/uploads/sites/2/2019/04/home-flowers.jpg" alt="Title of the blogpost"></a>
    <h3><a href="#">Hide links</a></h3>
    <p>Use muliple links, but hide them for keyboard and screen reader users.</p>     <p>Use tabindex="-1" aria-hidden="true" together on a link.</p>
  </li>
</ul>

              
            
!

CSS

              
                * {
  font-family: sans-serif;
  color: #333;
}


ul {
  padding-left: 0;
}

li {
  list-style: none;
  width: 20em;
  border: green 2px solid;
  padding: 1em;
  margin-bottom: 1em;
}

li.card a{
  text-decoration: none;
}

li.card a:hover, 
li.card a:focus {
  text-decoration: underline;
}

img { 
  width: 20em;
}

.to-be-covered {
  position: relative;
}

.to-be-covered:focus-within {
    box-shadow: 0 0 0 0.25rem;  
}

.to-be-covered:hover {
    box-shadow: 0 0 0 0.25rem;  
}

.to-be-covered a span {
  position: absolute; 
  width: 100%; 
  height: 100%; 
  top: 0; 
  left: 0;
}

.pseudo a::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
}

/* extra link */
p a {
  text-decoration: underline;
  position: relative;
  z-index: 1;
}

p a:hover,
p a:focus {
  text-decoration: none;
}
              
            
!

JS

              
                      
              
            
!
999px

Console