我正在尝试设置wp_list_categories
使用 CSS 将逗号放在项目之间的输出样式。但是,逗号前出现了一个空格,我真的无法理解它来自哪里!
我做了一个jsbin来演示和比较。
截屏:
HTML:
<ul id="category-listing">
<li class="cat-item cat-item-6"><a href="#" title="View all posts filed under Branding">Branding</a>
</li>
<li class="cat-item cat-item-4"><a href="#" title="View all posts filed under Environment">Environment</a>
</li>
<li class="cat-item cat-item-5"><a href="#" title="View all posts filed under Exhibition">Exhibition</a>
</li>
<li class="cat-item cat-item-8"><a href="#" title="View all posts filed under Lecture">Lecture</a>
</li>
<li class="cat-item cat-item-9"><a href="#" title="View all posts filed under Photography">Photography</a>
</li>
<li class="cat-item cat-item-10"><a href="#" title="View all posts filed under Print">Print</a>
</li>
</ul>
CSS:
li {
font-size: 46px;
display: inline;
margin: 0;
padding: 0;
}
#category-listing li:after {
content: ', ';
}