I don’t know your purpose, but you can target the titles using several methods.
-
Use HTML title tags with data-attributes, such as
<h1 data-header-1>Chapter 1</h1>
so you can target[data-header-1]
with CSS. -
Insert empty div with a data-attribute aty some point, that you can use to target following elements. For example, putting
<div data-next-titles></div>
after the 2nd title and adding this CSS:[data-next-titles] ~ .d-toc-post-heading { color: pink; }
Will make this:
So, it really depends on your goal.
This guide might be of some help: Customize posts' contents with your own styles