I want cssClasses to work in embedded blocks

Use case or problem

As shown here, I used a cssclasses to center the title, but the css didn’t work when it was embedded

Moved to help for now.

There may be a CSS solution for what you want.

Something like this might work:

.center-h :is(.HyperMD-header-1, h1) {
    text-align: center; }

.center-h :is(.HyperMD-header-2, h2) {
    text-align: center; }

Thanks. That’ll be grand!

.Kr_juben .HyperMD-header-1, .inline-title[data-level='1'], .HyperMD-list-line .cm-header-1 {
    text-align: center;

Like the one above, it can distinguish between the h1 of MD in edit mode and the h1 of outline mode
Is there a way to only center h1 in MD mode in reading mode ?

For only reading mode this could maybe work:

.Kr_juben h1 {
    text-align: center; }

like this

It is hoped that in reading mode, H1 in outline format does not go to the middle, and H1 in MD format goes to the middle. I don’t know if it’s possible

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