Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-10-2012, 08:43 PM   #1
drummerboy
Junior Member
drummerboy began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
Manually Anchor Images to Text

Hello,

I have a sort of conundrum. I know how to anchor images to text in InDesign but I am currently editing an ePub file without access to InDesign (I am away from my work computer) using Sigil. I want to manually anchor an image to some text so that they stay together if the text gets reflowed. By "manually" I mean that I want to code this into the XHTML. How would I go about doing this? I am unsure of what the proper way to do this would be. I've tried putting the image and text into a table and putting them within the same <p></p> tags with a <br/> between to maintain the top-down layout but nothing has worked. The text always gets separated from the image if reflowed.

I would also like to do this with headers - keep headers with the text they go over and I have been having the same problem.

I would appreciate any help you guys could provide.

Thanks!

Last edited by drummerboy; 08-10-2012 at 09:34 PM.
drummerboy is offline   Reply With Quote
Old 08-11-2012, 03:44 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Wrap both image and text in a <div> and apply "page-break-inside: avoid" to it with CSS. Unfortunately, not all readers obey this in all circumstances, even if the whole thing fits in a "page". Or include the text in the image
Jellby is offline   Reply With Quote
Advert
Old 08-13-2012, 05:54 PM   #3
drummerboy
Junior Member
drummerboy began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2012
Device: none
Thanks, Jellby. What I ended up doing was putting the image and text within <div> tags and applying: "display:inline-block; page-break-before:always;". I read that iBooks doesn't recognize the "page-break-x" attributes so "inline-block" would still be a way of keeping the elements together.

I was wondering if "page-break-before:always" is better than "page-break-inside:avoid"? The former would keep the images and text on a separate page away from other elements - I wasn't sure if this was a more reliable way of keeping the text and images together or if both would work equally, just in different ways?

Thanks for your help.
drummerboy is offline   Reply With Quote
Old 08-14-2012, 05:36 AM   #4
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
page-break-before:always forces a pagebreak before the block, page-break-inside:avoid should only insert the pagebreak if the block does not fit in the remaining page space. For large blocks (images) it's the same, but for smaller ones (or large pages), the former would insert unnecessary pagebreaks.
Jellby is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Enhancing text in scanned images crackhammer General Discussions 15 03-12-2012 06:09 AM
TEXT WRAP AROUND IMAGES RKEP71 Sigil 1 06-20-2011 08:26 PM
Variable position / anchor for images? jharker ePub 1 08-31-2010 04:40 AM
Images and text wrapping steveboyett Calibre 3 07-20-2010 08:26 PM
Text and images on k2 not as dark as k1 Matches Malone Amazon Kindle 25 02-27-2009 06:41 PM


All times are GMT -4. The time now is 06:22 AM.


MobileRead.com is a privately owned, operated and funded community.