Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
I am trying to find a way to keep a block of content on the same page that goes like this:
Text
Image
Text
So I have text, then a new line, then an image, then a new line, then more text. Here is what I currently have:
CSS:
.figure{
text-align: center;
page-break-after: avoid;
}
.figure span{
display: block;
}
HTML:
<p class="figure">
<span>Text 1</span>
<span><img src="path_to_image.jpg"></span>
<span>Text 2</span>
</p>
This is working to keep the block on the same page, but the problem is, if 'Text 1' and the image can fit on the same line, it does that and doesn't cause a line break. I even tried manually putting <br> between Text 1 and the image and it still doesn't work.