Css: Control space between bullet and <li>
⚡TLDR
Control space between a list bullet and <li>
using CSS padding
. Keep the bullet inside the list box model with list-style-position: inside;
on the <ul>
. Adjust padding-left
on <li>
:
Update 20px
according to your aesthetic senses.
Master class for bullet-chasers
The pseudo magic: custom bullets with ::before
Text wrapping party trick
Want flexible multiline text that doesn't wrinkle at the sight of bullets? Here's how:
Bullet's got a brand new image
To choose a bullet that's a spitting image of you:
Peeling the complex layers
Happily nested lists
Ever come face to face with nested <ul>
or <ol>
and wondered "What now?" Here's what:
All browsers aboard
Browser compatibility got you sweating? Not all browsers treat pseudo-elements equally. So test, retest, and then test some more.
Consistency, much needed coffee of CSS
No matter the styling, consistency is your best friend. Say no to distracting, odd ball list items and yes to clean sleek looks.
Linked
Was this article helpful?