Bold only the numbers or text in an ordered list with CSS
To make only the numbers in an ordered list bold, set font-weight: 700 on li::marker. To bold only the text, set the li to 700 and its ::marker to 400. Both approaches preserve the automatic numbering from ol and li.
Separate the marker’s weight from the item text
The number before a list item is its marker. When you set the li’s font weight, its marker can inherit that weight. ::marker lets you specify a separate weight for the marker. Apply .numbers or .content below to the relevant ol.
/* Bold only the numbers */
.numbers > li { font-weight: 400; }
.numbers > li::marker { font-weight: 700; }
/* Bold only the text */
.content > li { font-weight: 700; }
.content > li::marker { font-weight: 400; }
> li targets only direct items of that list. It does not select nested items directly, but font-weight can still inherit into a nested list. Set that list’s weight separately if it needs to stay normal. To make room for the number, adjust the list’s padding or marker position. ::marker does not accept ordinary box padding. See CSS Lists and Counters — ::marker.
Compare four lists and their automatic numbering
Save and open the example as list-weight.html. No other files or JavaScript are required. The four lists show the same two items at 9 and 10. The first uses normal weights, the second bold teal numbers, and the third bold text. The fourth restores normal text with a span and leaves the numbers bold.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Separate the weights of list numbers and text</title>
<style>
body { margin: 20px; font: 16px/1.6 system-ui, sans-serif; color: #203348; }
* { box-sizing: border-box; }
h1 { font-size: 24px; }
.sample { max-width: 520px; padding: 12px; margin: 12px 0;
border: 1px solid #9ab0bb; background: #f2f7f9; }
.sample h2 { margin: 0 0 8px; font-size: 18px; }
.sample ol { margin: 0; padding-inline-start: 2.6em;
list-style-type: decimal; list-style-position: outside; }
.sample li { margin: 6px 0; }
.numbers > li { font-weight: 400; }
.numbers > li::marker { font-weight: 700; color: #176f80; }
.content > li { font-weight: 700; }
.content > li::marker { font-weight: 400; }
.fallback > li { font-weight: 700; }
.fallback > li > .text { font-weight: 400; }
</style>
</head>
<body>
<h1>Compare ordered list weights</h1>
<section class="sample">
<h2>Default list</h2>
<ol class="plain" start="9">
<li>Check the files you prepared. When a long line wraps, it starts again at the same text indent.</li>
<li>Compare the results in the browser.</li>
</ol>
</section>
<section class="sample">
<h2>Bold numbers: ::marker</h2>
<ol class="numbers" start="9">
<li>Check the files you prepared. When a long line wraps, it starts again at the same text indent.</li>
<li>Compare the results in the browser.</li>
</ol>
</section>
<section class="sample">
<h2>Bold text: ::marker</h2>
<ol class="content" start="9">
<li>Check the files you prepared. When a long line wraps, it starts again at the same text indent.</li>
<li>Compare the results in the browser.</li>
</ol>
</section>
<section class="sample">
<h2>Bold numbers: span approach</h2>
<ol class="fallback" start="9">
<li><span class="text">Check the files you prepared. When a long line wraps, it starts again at the same text indent.</span></li>
<li><span class="text">Compare the results in the browser.</span></li>
</ol>
</section>
</body>
</html>
Add a third li to any list to get 11. Set value="12" on the second item and the sequence becomes 9, 12, 13. Remove the value and the extra item, then add reversed to the ol while keeping start="9". The numbers become 9 and 8. The weight rules do not affect that calculation. See HTML — ol and HTML — li.
In a narrow window, a long item’s next line aligns with the start of the text. The example uses list-style-position: outside and reserves space for the numbers with padding-inline-start. Check the padding if you need room for three-digit numbers.
Use a span to control text weight
Where marker styling is difficult, make the li bold and wrap its text in a span with a weight of 400. The marker keeps the weight of the li. Use the two snippets together.
<ol class="fallback">
<li><span class="text">First item text</span></li>
<li><span class="text">Second item text</span></li>
</ol>
.fallback > li { font-weight: 700; }
.fallback > li > .text { font-weight: 400; }
For text-only bold with the same structure, set li to 400 and .text to 700. Text outside the wrapper still inherits from li. If an item contains a nested list or block elements, wrap only the relevant text and leave those elements outside the span.
Diagnose missing markers or identical weights
If the numbers disappear, first look for list-style: none or a rule making the li itself display: flex or grid. Keep the li as a list item for the native marker. If you need Flexbox or Grid inside it, apply that layout to a separate inner element.
If the marker appears but the weights look the same, compare the computed font weights for li and ::marker. If both are 700, check competing rules. If the values are 400 and 700 and the difference is still subtle, check which weights the font provides and whether the browser synthesizes a weight.
Use strong for meaningful emphasis such as a warning. Use CSS for visual weight alone. Keeping the native marker also lets HTML control the starting number, descending order, and individual item values. See HTML — strong.




