I'm using something like this, seems pretty clean & simple for me:
ul {
list-style: none;
/* remove left padding, it's usually unwanted: */
padding: 0;
}
li:before {
content: url(icon.png);
display: inline-block;
vertical-align: middle;
/* If you want some space between icon and text: */
margin-right: 1em;
}
The above code works as is in most of my cases.
For exact adjustment you can modify vertical-align
, e.g.:
vertical-align: top;
/* or */
vertical-align: -10px;
/* or whatever you need instead of "middle" */
You may set list-style: none
on li
instead of ul
if you prefer.