BLOCK, Paragraph and Character Styles

(English is not my primary language)

I have been reading the tutorial and playing around the compile settings. It seems that the only formats one can apply are Paragraph and Character styles.

I am working primary with ePubs and Web Pages, so having options for custom HTML classes and Styles are great. Yet, I have not find (and at this point I think is not posible) a way to use/apply Styles that will generate a DIV surrounding paragraphs. For example: let’s suppose I want three paragraphs left-aligned but inside a box that is floating to the right. For this I can use a HTML/CSS like this:


Short Paragraph.

Another short one.

Longest paragraph of all.


.box { display:table; margin-left: auto; text-align: left; background: blue; }

The reason I need the DIV is so everything align to the left (and the box to the right) while using the longest paragraphs as the width setter. That way the left side of the block will be justified.

Notice that the margin-left only applies to the

(for the

s does not inherit that property) and the text-align to the paragraphs.

There are many other ways to accomplish this, but the point is that more often that not one need to use a DIV surrounding paragraph to manage more complex design.

If this option does indeed exist, please point me in the right direction. If not, please, consider adding a third type of style that create divs. That way I can select this 3 paragraph, apply a “Block” Style and then control it in the custom CSS options.

This will also make the creation of accessibility and other features in ePubs/HTML way better and easier.

Character Styles are the equivalent of (the universal display:inline). And we could use the “BLOCK” Style, the equivalent of

(the universal display:block).

Thank you.

If you are using MMD compile, you can easily assign

to a paragraph style (and to a character style), using the Style prefix/suffix in the compiler.

If you use Pandoc you can also use the new Fenced Divs as the prefix / suffix, which allows you to create styles for HTML based outputs and styles for word processors: … d-and-html

For the direct EPub3, the

syntax in prefix/suffix does not completely work (EPub3 compile also uses MMD but Keith may be injecting the prefix/suffix at the wrong time, or escaping HTML to deliberately stop it being used?). But try enabling treat as raw markup, the
blocks can also be applied to Section Layouts using the Compile settings even without using MMD - you just need to assign a CSS class name to the Section Layout in the Compile format. This does mean having your
block in its own document in the binder, of course.

All the best,