View Full Version : Text over image


kamanza
09-17-2012, 03:00 AM
This is the first time I'm trying to put some text over an image.

<div class="scr">
<p><img alt="" src="../Images/scroll.jpg" /></p>

<div class="part">
<p class="m1">PART I</p>
</div>
</div>

.scr {
margin-top:80px;
margin-left:100px;
}
.part {
position:absolute;
top:210px;
left:365px
}

It looks perfect in Sigil, but in ADE the text is below the image. Is there a way to place the text over an image that would work in EPUB?

Thanks in advance.

Jellby
09-17-2012, 04:09 AM
Don't use "position: absolute", it's discouraged (at least) by the spec, and its behaviour is probably undefined in ePub.

Try with SVG.

kamanza
09-17-2012, 05:44 AM
I've tried position:fixed & position:relative (with different values for top & left) with no success.
Funny that converted to mobi with kindlegen it looks as perfect as in Sigil.

And with SVG the same thing happens: text is placed correctly in Sigil & outside of the box in ADE.
Eventually, I just made 8 images for the 8 parts of the book.
But i'd still like to learn how to place text over image.

Jellby
09-17-2012, 10:49 AM
And with SVG the same thing happens: text is placed correctly in Sigil & outside of the box in ADE.

What did you do? You should include the picture and the text in the same SVG code.

kamanza
09-17-2012, 12:18 PM
How do I do that?

Never mind, found it online.
Thanks for the direction

dynabook
09-17-2012, 12:40 PM
Check out this excellent edition of "Treasure Island". It has text over the image on the title page.

http://www.mobileread.com/forums/showpost.php?p=2193024&postcount=1