AlexG AlexG - 1 year ago 118
HTML Question

Peudo elements: space between characters

I have a badge that adds brackets via CSS. Unfortunatelly it also adds spaces, is there a way to remove the spaces without a negative margin?

Current Output: Items ( 10 )

Desired Output: Items (10)

.badge:before {
content: '(';

.badge:after {
content: ')';


Answer Source

It adds spaces because you've got spaces in your markup. There are no spaces if you do this:

<span class="badge">10</span>
Items (10)