Within a <ul>
element, clearly the vertical spacing between lines can be formatted with the line-height attribute.
My question is, within a <ul>
element, how do I set the vertical spacing between the list items?
Within a <ul>
element, clearly the vertical spacing between lines can be formatted with the line-height attribute.
My question is, within a <ul>
element, how do I set the vertical spacing between the list items?
HTML
CSS
EDIT: If you don't use the special case for the last li element your list will have a small spacing afterwards which you can see here: http://jsfiddle.net/wQYw7/
Now compare that with my solution: http://jsfiddle.net/wQYw7/1/
Sure this doesn't work in older browsers but you can easily use js extensions which will enable this for older browsers.
I would be inclined to this which has the virtue of IE8 support.
JSFiddle
Many times when producing HTML email blasts you cannot use style sheets or style /style blocks. All CSS needs to be inline. In the case where you want to adjust the spacing between the bullets I use li style="margin-bottom:8px;" in each bullet item. Customize the pixels value to your liking.
setting padding-bottom for each list using pseudo class is a viable method. Also line height can be used. Remember that font properties such as font-family, Font-weight, etc. plays a role for uneven heights.
<br>
between<li></li>
line entries seems to work perfectly well in all web browsers that I've tried, but it fails to pass the on-line W3C CSS3 checker. It gives me precisely the line spacing I am after. As far as I am concerned, since it undoubtedly works, I am persisting in using it, whatever W3C says, until someone can come up with a good legal alternative.You can use margin. See the example:
http://jsfiddle.net/LthgY/