There is a familiar little moment in front-end work: the layout is almost right, but three stubborn dots make a navigation bar look unfinished. A global ul { list-style: none; } feels wonderfully decisive—until the article lists, footer links, and nested instructions lose their shape too.
The marker is visual; the list is meaningful. We can remove one without carelessly dismantling the other. The key is to scope the rule to the component that asked for it, then handle spacing and accessibility deliberately.
Start with the smallest honest change
Give the particular list a class. Keep the native <ul> and <li> elements: they communicate that the items belong together even when no dot is painted beside them.
<ul class="feature-list" role="list">
<li>Automatic backups</li>
<li>Two-factor authentication</li>
<li>Activity history</li>
</ul>A semantic unordered list with a component-specific class.
Why the HTML stays a list
The
<ul>says the order is not significant; each<li>identifies one item in that set.A class expresses presentation intent without affecting every unordered list on the page.
role="list"is a compatibility safeguard for Safari when CSS removes markers; it is not a reason to replace semantic elements with generic<div>tags.Meaningful text remains in each item. The missing bullet never becomes the only carrier of information.
.feature-list {
list-style-type: none;
margin-block: 0;
padding-inline-start: 0;
}Remove native markers and their default logical indentation from one list.
Each declaration has a separate job
list-style-type: noneremoves the generated marker glyph.padding-inline-start: 0removes the usual start-side indentation and adapts to left-to-right and right-to-left writing directions.margin-block: 0removes vertical list margins only when the component layout owns that spacing.The longhand property says exactly what is changing.
list-style: noneis also valid, but its shorthand resets type, image, and position together.No negative margin is needed. Values such as
margin-left: -70pxhide a symptom and break as fonts, containers, and writing direction change.
Navigation lists need layout and focus, not just missing dots
Navigation is one place where a list without visible markers feels natural. The list still groups related destinations, while flexbox handles the row. Link focus remains visible for someone navigating by keyboard.
<nav aria-label="Primary">
<ul class="site-nav" role="list">
<li><a href="/docs/">Docs</a></li>
<li><a href="/examples/">Examples</a></li>
<li><a href="/support/">Support</a></li>
</ul>
</nav>A named navigation landmark containing a real list of destinations.
The structure helps in quiet ways
The
<nav>landmark and its accessible label identify the region; the list groups the links inside it.Real anchors preserve browser behavior such as opening a link in a new tab and exposing its destination.
role="list"protects list announcement in the Safari marker-removal case.The links have useful text without depending on position, color, or a decorative icon.
.site-nav {
display: flex;
flex-wrap: wrap;
gap: 0.75rem 1.25rem;
list-style: none;
margin: 0;
padding: 0;
}
.site-nav a:focus-visible {
outline: 3px solid currentColor;
outline-offset: 0.25rem;
}Let flexbox arrange the items while preserving a visible keyboard focus indicator.
What the navigation CSS protects
gapcreates spacing without attaching fragile margins to individual items.flex-wrap: wraplets destinations move to another line instead of overflowing a narrow screen.list-styleis reasonable here because the component deliberately replaces all three list-style subproperties.The
:focus-visiblerule makes keyboard focus discoverable without forcing an outline during every pointer click.currentColorfollows the link color and remains adaptable across themes; contrast still needs checking in the real design.
Let nested content keep its visual grammar
Cards and feature grids often want an unmarked outer list while explanatory sublists still need bullets. A child combinator prevents the outer component rule from quietly leaking into every descendant.
.feature-list {
list-style: none;
margin: 0;
padding-inline-start: 0;
}
.feature-list > li + li {
margin-block-start: 1rem;
}
.feature-list > li > ul {
list-style-type: disc;
padding-inline-start: 1.5rem;
}Remove markers from the outer component while retaining bullets and indentation in direct nested lists.
The selector boundaries are the important part
.feature-list > li + lispaces only an item preceded by a sibling item, so there is no unnecessary gap above the first.The direct-child combinators describe the expected component structure instead of matching unrelated deeper lists.
The inner list explicitly restores
discand a logical start padding.If the markup can contain wrappers or deeper nesting, adjust the selectors to that real structure rather than increasing specificity blindly.
Sometimes the bullet deserves a redesign, not removal
If markers make the list easier to scan, keep them and style ::marker. This avoids decorative pseudo-elements that must be aligned by hand.
.requirements li::marker {
color: #7c3aed;
font-size: 1.15em;
}
.steps {
list-style-position: outside;
}Restyle native markers while allowing wrapped text to align beneath the list item content.
Native markers keep useful behavior
::markertargets the browser-generated bullet or number; only a limited set of properties applies to it.list-style-position: outsidekeeps the marker outside the principal text box, which usually makes wrapped lines easier to scan.Do not put essential status or instructions only in generated marker content; assistive-technology treatment of generated content can vary.
When you only need a different color or size, retaining the marker is simpler and more robust than rebuilding it with
::before.
When the dot refuses to disappear
The declaration is crossed out in DevTools: a later, more specific, or
!importantrule wins. Find the owner in the Styles panel before raising specificity.A symbol remains after `list-style: none`: inspect
li::before,li::marker, background images, and inline SVG. It may not be a native marker.The bullet is gone but the text is still indented: inspect computed
padding-inline-start,margin-inline-start, and inherited component spacing.Two symbols appear: a custom
::beforeicon was added without disabling the native marker.Nested bullets vanish: a broad descendant selector such as
.component ulis reaching farther than intended; use direct-child selectors or restore the nested style.The CSS works in one page but not WordPress content: editor, theme, and block styles may load after the custom stylesheet. Inspect the final cascade on the rendered page.
A right-to-left page shifts incorrectly: replace physical left/right spacing with inline logical properties.
The list no longer sounds like a list in Safari: retain
<ul>/<li>and addrole="list"when removing its marker, then test with the browser and screen reader combination your audience uses.
A small visual change can still be a careful one
Removing a bullet should not make the rest of the page harder to understand. Scope the selector, reset only spacing the component owns, keep nested lists purposeful, and listen to the result with assistive technology when the pattern matters. That extra minute is often the difference between CSS that merely looks finished and a component that actually is.
Comments and corrections