Center align selected (inline) titles only

So I’ve stumbled upon the following CSS:

.inline-title {
    text-align: center;
}

It works, but I would like to add a property in frontmatter for this CSS to apply on selected notes only, instead of my entire vault. Is there a way to do so? Thanks in advance.

.inline-center .inline-title {
    text-align: center;
}

Adding a custom class before what you have (with a space) should do it. The class can be pretty much anything as long as it’s not used somewhere else in your vault.

And then add that into the cssclasses YAML/Property for the notes you’d like to change.

https://help.obsidian.md/Editing+and+formatting/Properties

1 Like

This works, and it was just a simple tweak! Thanks, def need to learn more about CSS.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.