Skip to main content
Known Participant
April 3, 2024
Answered

Is there an html code to pad a text into a background for reflowable epub export

  • April 3, 2024
  • 2 replies
  • 177 views

Hi all, am trying to create a reflowable epub and i have a few sections of text which i want to be inside a grey background. Pls is there an html code that i can integrate into the script when i use calibre to edit it so that it places the text inside the background. Also, the text is left align, hence i need to make sure that the background somehow squares/rectangles the text and does not extend to the edge of the page right side margin. It should just stay within the confines of the text.

 

I think this is something related to padding but am unable to find anything specific to what i am looking for. All i see is that the padding cuts across the both left and right borders of the text. That is from the left margin to the right margin. I do not need it to get to the right margin but only stays within the confines of the text and remain reflowable.

 

Thanks in advance.

This topic has been closed for replies.
Correct answer James Gifford—NitroPress

I can't help with post-editing in Calibre or any other app, as I thoroughly believe EPUB surgery is one with lead type — obsolete.

 

As far as getting text in a tinted box, though, simply use InDesign's Text Shading feature as part of a style. You should be able to achieve almost anything (relative size of 'box,' shading margins, tint, etc.) with just the Shading menu. You can touch up a few things that ID doesn't support well, like rounded corners, using a few CSS statements pinned to that style.

 

Happy to assist further if that's not enough of a pointer.

2 replies

James Gifford—NitroPress
Legend
April 3, 2024

I can't help with post-editing in Calibre or any other app, as I thoroughly believe EPUB surgery is one with lead type — obsolete.

 

As far as getting text in a tinted box, though, simply use InDesign's Text Shading feature as part of a style. You should be able to achieve almost anything (relative size of 'box,' shading margins, tint, etc.) with just the Shading menu. You can touch up a few things that ID doesn't support well, like rounded corners, using a few CSS statements pinned to that style.

 

Happy to assist further if that's not enough of a pointer.

BobLevine
Community Expert
Community Expert
April 3, 2024

Is this related to your other post?

Stopping indesign from rasterizing layers - Adobe Community - 14533482

The answer is the same; you need to use styles.