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

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 11-15-2017, 09:54 PM   #1
AlanHK
Addict
AlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheese
 
AlanHK's Avatar
 
Posts: 348
Karma: 1002
Join Date: Apr 2014
Device: PW-3, Android phone
Centred and scaled image not centred or scaled

I'm placing an image on a promo page like this:

Code:
<div class="center">
    <img alt="ad-subs" src="../Images/ad-subs.jpg" class="img60"/>
</div>
the CSS:
Code:
.center {
    text-align: center;
    text-indent: 0;
}

.img60 {
    width: 60%;
    margin-left: 20%;
    margin-right: 20%;
}
The intention is to have the image-- 800 wide x 438 high -- in the middle, scaled to 60% of page width.
And that's what I see in Sigil, and Calibre in the ePub.
When I export to AZW3 and load on a PW3, what I see is an image that is about 8 cm wide on the 9cm wide screen, with a left margin of 2cm, cut off on the right side -- i.e. image is 90% of page width, off-centre.

It seems that the left margin is about 20% of the page width, but the image is not being scaled to 60%.

How can I fix this?

Last edited by AlanHK; 11-15-2017 at 09:59 PM.
AlanHK is offline   Reply With Quote
Advert
Old 11-15-2017, 10:40 PM   #2
AlanHK
Addict
AlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheese
 
AlanHK's Avatar
 
Posts: 348
Karma: 1002
Join Date: Apr 2014
Device: PW-3, Android phone
Well, found a solution, if not an explanation:

scaling in the outer div instead of the image tag made it work.

Code:
<div class="img60">
     <img alt="ad-subs" src="../Images/ad-subs.jpg" class="img100"/>
</div>

.img100 {width: 100%;}
.img60 {width: 60%;
    margin-left: 20%;
    margin-right: 20%;}
Both are identical in epub, but only this is as intended in AZW3.
AlanHK is offline   Reply With Quote
Old 11-20-2017, 07:52 AM   #3
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,112
Karma: 480516
Join Date: Dec 2012
Device: Kindle
But it's 100% on the "Mobi 7" devices, right? Do you use a media call to handle those?
Notjohn is offline   Reply With Quote
Old 11-20-2017, 09:54 AM   #4
AlanHK
Addict
AlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheeseAlanHK can extract oil from cheese
 
AlanHK's Avatar
 
Posts: 348
Karma: 1002
Join Date: Apr 2014
Device: PW-3, Android phone
Quote:
Originally Posted by Notjohn View Post
But it's 100% on the "Mobi 7" devices, right? Do you use a media call to handle those?
Not even looking at mobi7, I just make AZW.

This book requires KF8 for fonts and other features, how KF7 looks I don't really care.
AlanHK is offline   Reply With Quote
Old 11-23-2017, 02:01 PM   #5
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 5,916
Karma: 55190324
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, and NookColor. 2 Droid, 1 Win8 ePUB rdrs
Quote:
Originally Posted by Notjohn View Post
But it's 100% on the "Mobi 7" devices, right? Do you use a media call to handle those?
To answer your question, NJ: yes. It will be 100%. You can't work around KF7's issues with images with a media query alone. To do it correctly, you put the image in twice (call it twice, I mean); once in a KF8 div, once in a KF7. In the KF7, you assign the fixed-size of the image, so that it's not overdriven; in the KF8, you call it with a %.

You hide each from the other--which is where the MQ's do come in to play. William's plugin does that work for you, if you use it.

Hitch
Hitch is offline   Reply With Quote
Old 11-24-2017, 07:10 AM   #6
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,112
Karma: 480516
Join Date: Dec 2012
Device: Kindle
Quote:
Originally Posted by AlanHK View Post
how KF7 looks I don't really care.
That's my feeling as well. While I'm not a fan of Apple's obsolescence-by-design, there is a point where we should stop using shields and bucklers (whatever a buckler may be) and adopt Kevlar body armor.
Notjohn is offline   Reply With Quote
Old 11-24-2017, 10:28 AM   #7
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 5,916
Karma: 55190324
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, and NookColor. 2 Droid, 1 Win8 ePUB rdrs
Quote:
Originally Posted by Notjohn View Post
That's my feeling as well. While I'm not a fan of Apple's obsolescence-by-design, there is a point where we should stop using shields and bucklers (whatever a buckler may be) and adopt Kevlar body armor.
That's a luxury that I don't have.

Hitch
Hitch 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
kindle bug with scaled images poetrycoder Workshop 7 11-12-2015 07:58 AM
correct interpretation of <br> with centred text cybmole Sigil 23 08-16-2014 11:55 AM
Calibre window displays scaled holiveros Calibre 3 08-01-2013 01:28 PM
Scaled images in iBooks ckirchho Apple Devices 5 06-25-2010 06:21 AM
last line in each paragraph centred scgf Calibre 9 09-10-2008 03:23 PM


All times are GMT -4. The time now is 02:51 AM.


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