Another question. I added extra div to the post. Now it looks like this:
<div data-theme-toc="true"> </div>
<div data-theme-profile="manual">
## Chapter 1
## Chapter 2
</div>
But the TOC is not visible in this case. How can it be fixed?
Another question. I added extra div to the post. Now it looks like this:
<div data-theme-toc="true"> </div>
<div data-theme-profile="manual">
## Chapter 1
## Chapter 2
</div>
But the TOC is not visible in this case. How can it be fixed?
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
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.