When your document is ready to be exported, you may find that the exporting process will produce unexpected results. This happens because InDesign will look at the frames on your page from left to right and then from top to bottom. Depending on how your frames are located on your page, you may find that an item that was in the middle of your page ends up at the bottom. Here is an example:
Note that there are four frames in this document, one for the title, one for the upper graphic, on for the text and one for the lower graphic.
With this document as it is, let’s export it as an EPUB without any adjustments. We will save it to a folder on our computer naming it something appropriate, like Chapter 1. Then go to File>Export (choose HTML for the Save as type)
The first frame on the left side of our document is the text frame so that is first in our element on our page. Moving to the left, the next frame was our title frame, so this makes sense. The third element moving from left to right is the colorful graphic and the last element was at the bottom of our document, so there it sits.
All of our elements are here. It is just not the way we want it to look.
How do we fix this to get the result we want? A few minor adjustments to our set-up and we will be there. Let’s go back to our original document and open up the Articles panel by going to Window>Articles. Use the Selection tool to “rubber band” all the objects on our page so that you see the bounding box around each item. Press and drag the selection to the articles panel. You will see each item listed within the panel. You can rearrange each item with the intent of getting the items in the order that you want them to appear on the page. To find out which item in the article panel is the item on the page, double click on an article in the Articles panel. The corresponding item on the page will be highlighted. Then press and drag the article to the level you would like it to be.
Save your work, and then to go File>Export. Be sure that it will be saved as HTML and save your work. In the options menu, change the Content Order to Same as Article Panel and click OK. Now things are in the correct order, but not where we want them still. What we need to do is anchor the graphics to the text.
So, back in our original document, select one of the graphics, or text boxes (like the Chapter 1, title), so that you see the bounding box. On the upper-right side of the bounding box, you will see a solid blue square. With the Selection tool, click on this blue box and press and drag it to the text it should be anchored to.
Much better, but still not perfect. The graphics are now viewable and wrapped, but it would be more desirable to wrap the text around the graphic.
Let’s do one more thing with the graphics in the article. With the Selection Tool, select the lower graphic and right click. Choose Object Export Options and activate the EPUB and HTML tab. Select the check box in front of Custom Layout and from the dropdown choose Float Right. Then click done.
We will do the same thing with the upper (not top) graphic but the setting chosen will be Float Left.
BTW, HTML does not like anything but square/rectangular text wrap shapes!