|
|
#31 |
|
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() Posts: 3
Karma: 530
Join Date: May 2012
Device: Kindle Voyage
|
I use this code for poems; it doesn't work in ADE, but it does in Kindle. It functions similarly to the code with `width: fit-content`.
Code:
blockquote.poem {
display: table;
margin: 1em auto;
padding: 0 1em;
}
|
|
|
|
|
|
#32 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 537
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Yes, I agree that the auto L/R margins are necessary. My question was about the center class, though. I haven't observed any difference with it or without it, but that doesn't mean there isn't one...
Last edited by ElMiko; Yesterday at 07:40 AM. |
|
|
|
|
|
#33 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 537
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Hmmm interesting. I might want to take a little from column a and a little from column b. I take it the L/R padding is to set fixed values rather than the % Max width in RbnJrg's solution.
|
|
|
|
|
|
#34 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,418
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
P.S. The CSS code does work in ADE/RMSDK Last edited by JSWolf; Yesterday at 06:36 AM. |
|
|
|
|
|
|
#35 |
|
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,465
Karma: 20550481
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
|
|
|
|
|
|
#36 |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 537
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
|
|
|
|
|
|
#37 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,418
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
I had a search through ePubs I've read and some do have display: table; in the CSS and they works no problem. I do not see anything in the CSS that @Horus01 posted that does not work in ADE/RMSDK. Last edited by JSWolf; Yesterday at 06:36 AM. |
|
|
|
|
|
|
#38 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 82,418
Karma: 151278869
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
|
|
|
|
|
#39 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 537
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
The code does not work in ADE 2.X. In fact, it gets REALLY funky. The "auto-centering" fails, but it also then duplicates all the text and displays each line as a separate cell in a row. And the top and bottom margins fail. (Also, with my modified "inline-block" attribution, this doesn't get aligned right, either). See imageADE-H attached. RbnJrg's code also fails to "auto-center", applying the 85% max-width constraint right-to-left rather than 7.5% on either side. It also ignores the "fit-content" property. See imageADE-RJ attached. And in my modified code, which steals a bit from RbnJrg and a bit from Horus01, the auto-center effect fails (although in this particular case it gives the illusion of centering because of the right-aligned attribution), as does the "fit-content" property. See imageADE-EM attached. Spoiler:
However, in both RbnJrg's and my FrankenCode, it doesn't produce any MAJOR readability issues that I can discern. It just doesn't look as nice as it would in an application that isn't total trash. So, in summary: 1) The only code that you endorsed (other than your own, which didn't address any of the concerns in the original post) has serious readability issues in ADE, which Horus01 rightly pointed out from the jump. 2) The apparent readability of RbnJrg's and my new code (courtesy of RbnJrg's and Horus01's tips & tricks) means that your constant refrain that we use code optimized for ADE 2.X is basically taking the position that ebooks should look mediocre across all platforms rather than looking good in several and mediocre only in ADE. I can comfortably say: this is a weird take. 3) Thank you again to RbnJrg and Horus01 for their help. Teamwork apparently does make the dream work. EDIT: P.S. in my code snip above, I'm defining the L/R boundaries in em units because I want the max-width to be relative to paragraph indents (which i usually set at 1.5em) rather than the width of the screen. However, if I used % units to define paragraph indents (e.g. "text-indent: 5%;") I think one could basically acheive the same result as RbnJrg's original code by using "padding: 0 7.5%;" instead of the max-width property... I think. I'll let RbnJrg confirm or clarify this, though. Last edited by ElMiko; Yesterday at 09:05 AM. |
|
|
|
|
|
|
#40 | |||
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,919
Karma: 9553607
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
Code:
<div class="center"> /* Here there is no margin at all */ <div class="block"> /* Here I suppose you have a bottom margin */ ... ... </div> /* After that, a bottom margin of 1em */ </div> /* After that, no bottom margin */ Quote:
Quote:
|
|||
|
|
|
|
|
#41 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,919
Karma: 9553607
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
|
|
|
|
|
#42 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,919
Karma: 9553607
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
You want a center block with text aligned to left. If you, instead of "width: fit-content" and "max-width: 85%" (or whatever) employ L/R padding, if your stanzas are short, then all of them won't be centered, you'll have a lot of blank space on the right side. With my code, the width is automatic (fit-content) and the block will be centered acording to the longest stanza.
|
|
|
|
|
|
#43 | |
|
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 537
Karma: 65460
Join Date: Jun 2011
Device: Kindle Voyage, Boox Go 7
|
Quote:
what i'm referring to is my code that blends your css and Horus like this: Code:
div.bqib {
margin: 1em auto;
padding: 0 2em;
display: block;
width: fit-content;
}
I've attached two images below. One uses your max-width + fit-content approach, and the other uses your fit-content + Horus01's padding. In all other respects they are the same. For blocks where all the lines are short, it appears to center everything exactly the same in both cases... It's just the the "borders" of the block are basically being defined in your code from the inside-out and in the other case from the outside-in. |
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Inline-block and float interaction | ElMiko | ePub | 15 | 08-27-2025 04:01 AM |
| Inline-block | eggheadbooks1 | Sigil | 3 | 10-31-2016 03:07 AM |
| Creating epub with inline block problem | Gerlyn | ePub | 5 | 12-22-2011 01:59 PM |
| Does mobi support display: inline-block; | DeniseL | Kindle Formats | 2 | 09-30-2011 07:33 PM |