I have multiple lines that I want enclosed in a border:

enter image description here

     <p class="Book-Content_Chapters_Body-Text ParaOverride-1">What is the result of running ...
     <p class="Book-Content_Chapters_Body-Text ParaOverride-1">javac DeclarationsInJava.jav....

When I set this using the border checkbox in paragraph properties, it displays as expected within InDesign. However, when I export to epub, there is no border. It generates a CSS style ParaOverride-1 in the epub. The style reads

    p.ParaOverride-1 {

If I add border-width:0.75pt; to the style, each p gets its own block, and I lose the effect of having the p's together in a single rectangle.

enter image description here

From an HTML/CSS perspective, I believe the way to do this would be to enclose the bordered set of p's into a div that had the border styling applied.

My question is, what do I have to do in InDesign to have it generate an epub with a div inserted into a sequence of p elements for purposes of putting a single bordering rectangle around those elements?

  • Pure guess... perhaps an anchored text frame in the primary text frame with a stroke applied to the anchored frame???
    – Scott
    Mar 10 at 19:43
  • @Scott that sounds exactly right, this is really a question about configuring objects in Indesign. Does an "anchored text frame" provide a way to establish an anchor in text? When I create a frame it does not seem to insert an anchor at the insertion point, and maybe I am missing a step.
    – John
    Mar 14 at 14:17
  • Anchored objects within text are anchored to the text. So for example, if you anchor a text frame to "A random line of text." Where you anchor it can make a difference... "aA random line of text." will behave differently than "A randoma line of text." which may behave different than "A random line of text.a" Sometimes it's about where the anchor is placed (by click-dragging the anchor icon).
    – Scott
    Mar 14 at 14:22
  • This might help: adobepress.com/articles/article.asp?p=1311990&seqNum=4 It's for CS4, but the theories are all still true. And there's this, which is more recent: helpx.adobe.com/indesign/using/anchored-objects.html
    – Scott
    Mar 14 at 14:24
  • @Scott yes you nailed with that answer, thank you. I got the text to flow around it using "above line" positioning on the anchored object.
    – John
    Mar 15 at 13:58


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.