![]() |
#1 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Sep 2015
Location: West Virginia
Device: Kindle
|
how to use device independent (dp) in HTML to MOBI
I need help making images look the same across devices.
I am developing an ebook to publish on Fire HD, HDX, HDX 8.9 and the new HD 10. I create the content in HTML format, which includes includes images that are tagged in px units. I assemble the ePub using Sigil. I view the ebook using Amazon Fire HD Previewer, that lets me see the book in HD (which I assume means HD7), HDX (which I assume is HDX8), and HDX 8.9. The previewer cannot not simulate HD 10 yet. The images look big in HD, fine in HDX, and tiny in HDX 8.9. I changed the HTML to tag the figures in dp units instead of px but nothing changed. I read that dp units means the dp=px at 160 dpi device but the image should scale for devices with higher dpi. It does not happen in the Previewer. What am I doing wrong? |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
mostly an observer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,519
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
I use images 800 pixels wide and include a width="100%" instruction in the html.
|
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,764
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Set the "width" of your images in "%" (of the screen) in your .css stylesheet and set the height to "auto".
|
![]() |
![]() |
![]() |
#5 | |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Sep 2015
Location: West Virginia
Device: Kindle
|
% works sometimes, sometimes not
Quote:
Code:
<tr id="a0000000013"> <td style="width:40%"> </td> <td style="vertical-align:middle; text-align:right"> <img src="images/img-0004.png" alt="$\displaystyle \delta $" style="vertical-align:0px; width:10px; height:" class="math gen" /></td> <td style="vertical-align:middle; text-align:left"> <img src="images/img-0005.png" alt="$\displaystyle = a + x_{x_ y} + a + x_{x_ y} + a + x_{x_ y} + a + x_{x_ y} $" style="vertical-align:-10px; width:411px; height:" class="math gen" /></td> <td style="width:40%"> </td> <td style="width:20%" class="eqnnum"><span>(<span>1.1</span>)</span></td> </tr> </table> <p> where <img src="images/img-0004.png" alt="$\delta $" style="vertical-align:0px; width:0.52%; height:" class="math gen" /> is the ineffective length. ![]() is 10px wide, 18px tall. I calculated the % as %=100*px/WR, where WR is the device resolution along the with. I try this in my 1920x1080 monitor (landscape) and a fire HD (800 px.) It works when I put the % value inline, but it does not work at all when I put the same value (0.52%) in place of the 10px for the same figure inside the table cell. ??? img-0004.png http://barbero.cadec-online.com/pape...e/img-0005.png ![]() Thanks! |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,764
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Well, now I understand better what you want. Since I don't have your classes "mat gen" and "eqnnum" your results could be different from mine but try this code:
Code:
<body> <table> <tr id="a0000000013"> <td style="width:40%"> </td> <td style="vertical-align:middle; text-align:right"><img alt="$\displaystyle \delta $" class="math gen" src="../Images/img-0004.png" style="vertical-align: middle; width: auto; height: 1.2em" /></td> <td style="vertical-align:middle; text-align:left"><img alt="$\displaystyle = a + x_{x_ y} + a + x_{x_ y} + a + x_{x_ y} + a + x_{x_ y} $" class="math gen" src="../Images/img-0005.png" style="vertical-align: middle; width: auto; height: 1.2em" /></td> <td style="width:40%"> </td> <td class="eqnnum" style="width:20%"><span>(<span>1.1</span>)</span></td> </tr> </table> <p>where <img alt="$\delta $" class="math gen" src="../Images/img-0004.png" style="width:auto; height: 1em" /> is the ineffective length.</p> </body> Regards EDIT: By the way, you don't need to employ an inline image for the delta symbol. Instead you could use: Code:
<p>where <span style="font-family: Symbol; font-size: 1.2em">d</span> is the ineffective length.</p> Last edited by RbnJrg; 09-26-2015 at 03:56 PM. |
![]() |
![]() |
![]() |
#7 |
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,549
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Note that then the delta will be found as "d" when searching, and it will look different from the image.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
HTML to MOBI | kaushik | Conversion | 2 | 04-13-2012 08:30 PM |
Problem with html -> Mobi conversion - html tags visible. | khromov | Calibre | 9 | 08-06-2011 11:25 AM |
Convert HTML to MOBI (HTML recognized as ZIP file) | pdubois | Conversion | 1 | 01-25-2011 12:55 PM |
mobi -> html | mor0o0o | Calibre | 13 | 12-05-2009 08:02 AM |
HTML to mobi How to | AlexBell | Calibre | 0 | 06-30-2009 01:17 AM |