title: Drupal 8 - Adding classes to links
body: <p>I am new to Drupal and I love it very much. I am learning it on my own but I am stuck on a problem right now.</p>
  
  <p>I created a custom block that display a title and a list of links. So the only fields in that blocks are of type links. It's a block for my footer region. So when the user clicks, it opens a new website in a new tab.</p>
  
  <p>I want to alter the html output just for this block type, so I took out this theme suggestion:
  field--block-content--field-links--footer-links.html.twig</p>
  
  <p>My problem is how to add a class to every <code>&lt;a&gt;</code>tag?</p>
  
  <p>I tried using the module 'link class'. It works buggy. It only reads the classes that already exists in the css prior to installing the module. It doesn't read new classes created after installing the module. I tried different things, cleared the cache many times but weird. There has to be a better way to add the classes without a module.</p>
  
  <p>Could anyone help me and show me the best way to add a class to my <code>&lt;a&gt;</code> tags?</p>
  
  <p>Thank you :)</p>
  
  <p>Here's the default template for</p>
  
  <pre><code>{% if label_hidden %}
    {% if multiple %}
      &lt;div{{ attributes }}&gt;
        {% for item in items %}
          &lt;div{{ item.attributes }}&gt;{{ item.content }}&lt;/div&gt;
        {% endfor %}
      &lt;/div&gt;
    {% else %}
      {% for item in items %}
       {{ item.content }}   -------------&gt; add class here
      {% endfor %}
    {% endif %}
  {% else %}
    &lt;div{{ attributes }}&gt;
      &lt;div{{ title_attributes }}&gt;{{ label }}&lt;/div&gt;
      {% if multiple %}
        &lt;div&gt;
      {% endif %}
      {% for item in items %}
        &lt;div{{ item.attributes }}&gt;{{ item.content }}&lt;/div&gt;
      {% endfor %}
      {% if multiple %}
        &lt;/div&gt;
      {% endif %}
    &lt;/div&gt;
  {% endif %}
  </code></pre>