![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, 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> Code:
.center { text-align: center; text-indent: 0; } .img60 { width: 60%; margin-left: 20%; margin-right: 20%; } 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. |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, 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%;} |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,518
Karma: 987654
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?
|
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 681
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
|
![]() |
![]() |
![]() |
#5 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
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 |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,518
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
|
![]() |
![]() |
![]() |
#7 |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
|
![]() |
![]() |
![]() |
#8 |
Bozana
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 25
Karma: 32224
Join Date: Jan 2013
Device: PC
|
![]()
I'm sorta having similar problems but I've gone down the rabbit hole with svg image:
In my stylesheet: .svg { display: block; margin-top: 1em; margin-bottom: 1em; text-align: center; margin-left: auto; margin-right: auto; width: 15%; } In my html: <p class="svg"><img alt="scrolls" src="scrolls.svg"/></p> and another, I tried using the viewbox method: <p class="svg" width="100%" height="100%" viewbox="0 0 45 30" preserveaspectratio="xMinYMin meet"><img width="45" height="30" alt="scroll" src="scroll.svg"/></p> as I have two svg images, scroll and scrolls. Both failed, when I open it in a epub application, such as Sony Reader for PC (see 2 attached pictures/screenshots), however, it's fine in Sigil and Calibre. I want to keep the size of scrolls.sgv, as I'm happy with the size, however, I would like scroll.svg to be smaller. I'm editing this in Sigil. Very bizarre! Any help with this, would be much appreciated. |
![]() |
![]() |
![]() |
#9 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
![]() |
![]() |
![]() |
#10 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,617
Karma: 8399999
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
![]() Code:
<p class="svg" width="100%" height="100%" viewbox="0 0 45 30" preserveaspectratio="xMinYMin meet"><img width="45" height="30" alt="scroll" src="scroll.svg"/></p> |
|
![]() |
![]() |
![]() |
#11 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
![]() Hitch |
|
![]() |
![]() |
![]() |
#12 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,570
Karma: 14328438
Join Date: Nov 2019
Device: none
|
|
![]() |
![]() |
![]() |
#13 |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |