A CSS tag I have never seen before

by Andrew Gertig on February 21, 2011

word-spacing

I have never seen this CSS tag before today, but it turns out it is useful for a number of different things. Its primary usage is for, as the name suggests, setting the space between words in such things as p (paragraph) elements.

The usage that I found for it was to remove the space between li (list item) elements in an unordered list.

I used it to make this:

Look like this:

To do this you have to set the word-spacing of the ul element to something like -4px and then set the spacing of the li element to 0px to make sure the words get spaced correctly.

It looks something like this:

ul { word-spacing: -4px; }
ul li { word-spacing: 0px;
}

I hope this helps someone else who may be searching about this same issue.

Previous post:

Next post: