Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 03-22-2021, 12:34 PM   #16
what
Enthusiast
what began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Mar 2021
Device: none
Quote:
Originally Posted by JSWolf View Post
So what are you going to do for Mobi? You also have to that into account. That's the problem trying to publish on Amazon using any sort of advanced formatting as you have to deal with Mobi, KF8, and KFX.
What do you recommend that I do?
what is offline   Reply With Quote
Old 03-22-2021, 09:03 PM   #17
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,621
Karma: 85000001
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
When you publish a book on Amazon it will be converted to multiple formats that are each rendered a bit differently. I suggest you keep it simple in order to have the best chance of it looking good on as many devices as possible.

I looked at a book from a major publisher recently with both portrait and landscape images that render well on my Kindle device in either orientation. The code used was:

Code:
HTML:
<figure class="IMG-NOS"><img id="fig2" class="img90"
src="../Images/image00123.jpeg" title="description" alt="description"/></figure>

CSS:
figure.IMG-NOS {
	display: block;
	margin-bottom: 0em;
	margin-top: 0em;
	text-indent: 0em;
	margin-right: 0em;
	margin-left: 0em;
	text-align: center;
}

img.img90 {
	width:100%;
}

Last edited by jhowell; 03-22-2021 at 09:45 PM.
jhowell is offline   Reply With Quote
Advert
Old 03-23-2021, 02:01 AM   #18
fbrzvnrnd
Fanatic
fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.
 
Posts: 556
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
Quote:
Originally Posted by jhowell View Post

Code:
HTML:

CSS:
figure.IMG-NOS {
	display: block;
	margin-bottom: 0em;
	margin-top: 0em;
	text-indent: 0em;
	margin-right: 0em;
	margin-left: 0em;
	text-align: center;
}
ouch: text-align for a block element?
fbrzvnrnd is offline   Reply With Quote
Old 03-23-2021, 02:32 AM   #19
what
Enthusiast
what began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Mar 2021
Device: none
Quote:
Originally Posted by fbrzvnrnd View Post
ouch: text-align for a block element?
As I read the code, the content of the block element is text-aligned. Actually that solution is the same as the one you provided. In both cases there is a block container (either FIGURE or P) and the content of that container gets centered using text-align.

Last edited by what; 03-23-2021 at 02:34 AM.
what is offline   Reply With Quote
Old 03-23-2021, 05:35 AM   #20
fbrzvnrnd
Fanatic
fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.
 
Posts: 556
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
Quote:
Originally Posted by what View Post
As I read the code, the content of the block element is text-aligned. Actually that solution is the same as the one you provided. In both cases there is a block container (either FIGURE or P) and the content of that container gets centered using text-align.
It's correct: but the figure content usually does not have text as content. It could have <p> and the <p> has - as content - text. A block element inside a block element with "text-align" is not centered (or at least it shouldn't) AFAIK
fbrzvnrnd is offline   Reply With Quote
Advert
Old 03-23-2021, 08:11 AM   #21
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,621
Karma: 85000001
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by fbrzvnrnd View Post
It's correct: but the figure content usually does not have text as content. It could have <p> and the <p> has - as content - text. A block element inside a block element with "text-align" is not centered (or at least it shouldn't) AFAIK
This is typical code for centering images. The <img> element is not a block element and is what gets aligned. <div> would work the same for the outer wrapper, but <figure> is more semantically informative. Using <p> would also work, but is semantically inferior and could introduce a skew to the centering because of indentation.
jhowell is offline   Reply With Quote
Old 03-23-2021, 08:43 AM   #22
fbrzvnrnd
Fanatic
fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.fbrzvnrnd ought to be getting tired of karma fortunes by now.
 
Posts: 556
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
Quote:
Originally Posted by jhowell View Post
This is typical code for centering images. The <img> element is not a block element and is what gets aligned. <div> would work the same for the outer wrapper, but <figure> is more semantically informative. Using <p> would also work, but is semantically inferior and could introduce a skew to the centering because of indentation.
To be honest I never used the text-align for a <div> or a <figure> for semantic reason: in an ebook I prefer that texts are marked with <p> or other semantic tags for text. I see the <div> more as a divider for giving structure to a document and marking areas of the document where there are no valid semantic markers. So I never used the text-align CSS property for images, because, well, images are not text. I remember there was different problems using text-align for images, maybe the newer programs handle this aspect better.
fbrzvnrnd is offline   Reply With Quote
Old 03-23-2021, 06:12 PM   #23
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 75,114
Karma: 131686272
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by jhowell View Post
This is typical code for centering images. The <img> element is not a block element and is what gets aligned. <div> would work the same for the outer wrapper, but <figure> is more semantically informative. Using <p> would also work, but is semantically inferior and could introduce a skew to the centering because of indentation.
But <figure> doesn't work with Mobi. So why is that better to use?
JSWolf is offline   Reply With Quote
Old 03-23-2021, 07:44 PM   #24
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,621
Karma: 85000001
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by JSWolf View Post
But <figure> doesn't work with Mobi. So why is that better to use?
It gets ignored which results in the image rendering correctly anyway.
jhowell is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle Previewer 3.40 - 64bit, SVG text, snap-block jhowell Kindle Formats 6 06-19-2020 09:02 AM
SVG not centering vertically Turtle91 Sigil 6 01-09-2020 03:43 PM
Centering svg node in xhtml AliceWonder ePub 2 09-13-2019 12:46 AM
Kindle Previewer 3 versus KDP Online Previewer Contre-jour Kindle Formats 3 05-29-2018 10:05 AM
Centering SVG graphics in iBooks? FunkeXMix ePub 8 01-04-2013 09:21 PM


All times are GMT -4. The time now is 09:43 AM.


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