|
|
#16 |
|
Enthusiast
![]() Posts: 28
Karma: 10
Join Date: Mar 2021
Device: none
|
|
|
|
|
|
|
#17 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,155
Karma: 92500001
Join Date: Nov 2011
Location: Charlottesville, VA
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. |
|
|
|
| Advert | |
|
|
|
|
#18 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 559
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
|
|
|
|
|
|
#19 |
|
Enthusiast
![]() Posts: 28
Karma: 10
Join Date: Mar 2021
Device: none
|
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. |
|
|
|
|
|
#20 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 559
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
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
|
|
|
|
| Advert | |
|
|
|
|
#21 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,155
Karma: 92500001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
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.
|
|
|
|
|
|
#22 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 559
Karma: 400004
Join Date: Feb 2009
Device: ONYX M96
|
Quote:
|
|
|
|
|
|
|
#23 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,665
Karma: 150249619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
|
|
|
|
|
#24 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,155
Karma: 92500001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
|
|
|
|
![]() |
|
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 |