2017-09-27 56 views
0

我一直用這個代碼鏈接到每個崗位的YAML前面的問題基於他們tag我的網站上相關的帖子:減少填充相關的職位傑基爾

{% for post in site.posts limit:5 %} 
    {% if post.url != page.url %} 
     {% for tag in post.tags %} 
       {% if page.tags contains tag %} 
<a href="{{ post.url }}">{{ post.title }}</a> 
      {% endif %} 
     {% endfor %} 
    {% endif %} 
{% endfor %} 

這工作得很好,但我想知道如何減少輸出中鏈接之間的填充。目前,他們是這樣的:

enter image description here

我怎樣才能讓他們看起來像這樣:

enter image description here

+0

有沒有辦法讓最終的HTML/CSS輸出?對Debug更好 –

回答

0

您可以嘗試在CSS是這樣的:

a {margin:0;padding:0; } 

或者,如果你不能添加你做的內聯樣式的CSS(這當然是n這是一個很好的做法)像這樣:

<a style="margin:0;padding:0;" href="{{ post.url }}">{{ post.title }}</a>