Is there a way to customize list items with colored squares before the text?
I've been searching for a solution, but haven't found it yet:
http://www.w3schools.com/cssref/pr_list-style-type.asp
Although they don't necessarily need to be list items, it seemed convenient as I want to style and display them in line, not on separate lines like in the image above.
I've attempted the following code:
<ul class="ordering">
<li><div></div><span>One</span></li>
<li><div></div><span>Two</span></li>
<li><div></div><span>Three</span></li>
</ul>
along with this CSS:
.ordering {
list-style:none;
min-width:250px;
}
.ordering div{
width: 12px; height: 12px; float: left;
}
.ordering span{
display: block;
float: left;
font-size: 11px;
line-height: 11px;
padding-left: 5px;
}
The issue I'm facing is that I can't separate them (they're stuck together), and when I have many items that exceed the size of the ordering
class, they break onto a new line while the square remains on the previous line, making the square + text appear disjointed.