Customize list item bullets using CSS
Based on @dzimney answer and similar to @Crisman answer (but different)
That answer is good but has indention issue (bullets appear inside of li
scope). Probably you don't want this. See simple example list below (this is a default HTML list):
Lorem ipsum dolor sit amet, ei cum offendit partiendo iudicabit. At mei quaestio honestatis, duo dicit affert persecuti ei. Etiam nusquam cu his, nec alterum posidonium philosophia te. Nec an purto iudicabit, no vix quod clita expetendis.
Quem suscipiantur no eos, sed impedit explicari ea, falli inermis comprehensam est in. Vide dicunt ancillae cum te, habeo delenit deserunt mei in. Tale sint ex his, ipsum essent appellantur et cum.
But if you use the mentioned answer the list will be like below (ignoring the size of the bullets):
• Lorem ipsum dolor sit amet, ei cum offendit partiendo iudicabit. At mei quaestio honestatis, duo dicit affert persecuti ei. Etiam nusquam cu his, nec alterum posidonium philosophia te. Nec an purto iudicabit, no vix quod clita expetendis.
• Quem suscipiantur no eos, sed impedit explicari ea, falli inermis comprehensam est in. Vide dicunt ancillae cum te, habeo delenit deserunt mei in. Tale sint ex his, ipsum essent appellantur et cum.
So I recommend this approach that resolves the issue:
li {
list-style-type: none;
position: relative; /* It's needed for setting position to absolute in the next rule. */
}
li::before {
content: '■';
position: absolute;
left: -0.8em; /* Adjust this value so that it appears where you want. */
font-size: 1.1em; /* Adjust this value so that it appears what size you want. */
}
<ul>
<li>Lorem ipsum dolor sit amet, ei cum offendit partiendo iudicabit. At mei quaestio honestatis, duo dicit affert persecuti ei. Etiam nusquam cu his, nec alterum posidonium philosophia te. Nec an purto iudicabit, no vix quod clita expetendis.</li>
<li>Quem suscipiantur no eos, sed impedit explicari ea, falli inermis comprehensam est in. Vide dicunt ancillae cum te, habeo delenit deserunt mei in. Tale sint ex his, ipsum essent appellantur et cum.</li>
</ul>
You mean altering the size of the bullet, I assume? I believe this is tied to the font-size of the li tag. Thus, you can blow up the font-size for the LI, then reduce it for an element contained inside. Kind of sucks to add the extra markup - but something like:
li {font-size:omgHuge;}
li span {font-size:mehNormal;}
Alternately, you can specify an image file for your list bullets, that could be as big as you want:
ul{
list-style: square url("38specialPlusP.gif");
}
See: http://www.w3schools.com/css/css_list.asp