I need an unordered list without any bullets
To obliterate bullets from <ul>
elements, set list-style-type: none;
in your lovely CSS:
This code snippet will banish bullets from all unordered lists in your webpage faster than you can say "abrakadabra".
You can employ inline CSS for a swift but rather messy fix:
Tweaking your unbulleted list
Zeroing padding & margin
To achieve consistency across different browsers, reset padding
and margin
to "big fat zero":
Frameworks for the bullet-less
Working with Bootstrap? Use some built-in helper classes:
This is suitable for Bootstrap 3, 4, and 5.
Aligning with style
Fix alignment issues by getting creative with text-indent
and padding-left
on li
:
Classy solution for recurring use
If you often need unbulleted lists, create a CSS class:
And then, tag your HTML list to this class:
Additional "pro" tips
Inline semantics on single list item
For an inline fix on a single list item, inline CSS will do the trick (not recommended for larger lists due to maintainability):
Global share of styles
You can globally apply your no-bullets
class to all li
items inside .no-bullets
using one simple rule:
Wrestling with conflicting styles
Got conflicting styles? Use !important
for enforcing your style or increase specificity:
Significance of verbosity
Improve your code's readability and maintainability by eliminating redundant styles and unnecessary verbosity.
Was this article helpful?