I came up with something similar that could save some HTML time:
<ul class="rozcestnik"> <li><a href="#" title="1">1</a></li> <li><a href="#" title="2">2</a></li> <li><a href="#" title="3">3</a></li> </ul>
CSS
.rozcestnik { list-style-type: none; padding: 0; margin: 2.5em 2em 0; } .rozcestnik li:before { background: url("icon.png") no-repeat scroll 50% 50% transparent; content: " "; display: block; height: 20px; left: -20px; position: absolute; top: 0; width: 20px; } .rozcestnik li { position: relative; padding-bottom: 5px; padding-left: 5px; }
According to the custom image list, you probably just need to adjust the top and size of ": before" and the addition of "li".
It works in all major browsers and in IE8 and more.
OndΕej Kohout
source share