09-14-2013, 03:49 PM | #1 |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Dumb question #________
The folloeing is one stanza of a poem,
Code:
<div class="poem"> <div class="stanza"> <span class="i0">Mi memoria en ti se ocupa</span><br /> <span class="i0">No te olvida un solo instante,</span><br /> <span class="i0">Y mi mente delirante En ti piensa,</span><br /> <span class="i0">en ti piensa sin cesar.</span><br /> </div> </div> advice Last edited by Jellby; 09-15-2013 at 05:19 AM. Reason: fixed markup |
09-14-2013, 04:19 PM | #2 |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
moved to a new thread. How can this have anything to do with regular expressions?
|
09-14-2013, 04:31 PM | #3 |
Grand Sorcerer
Posts: 27,478
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Depending on what the rest of the CSS looks like... it could be something as simple as:
Code:
.poem { text-align: center; } Code:
.stanza { text-align: center; } |
09-14-2013, 04:56 PM | #4 |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
|
09-14-2013, 05:11 PM | #5 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Create a div and center that div. Inside the div you can create your normal paragraphs or divs (with whatever you want) with its own alignment.
|
09-14-2013, 05:13 PM | #6 |
Grand Sorcerer
Posts: 27,478
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Sorry, I misunderstood your intent.
I don't know of any fail-safe way to exactly center the structure as a whole. You can probably get it close with margin/padding, but even that's not going to come through a user font-resize unscathed. Last edited by DiapDealer; 09-15-2013 at 07:31 AM. |
09-14-2013, 05:44 PM | #7 | |
eBook FANatic
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
|
Quote:
Thsnk you. |
|
09-14-2013, 06:20 PM | #8 | |
Wizard
Posts: 1,529
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
What you want, it can be done, at least in the modern .kf8 format. In your .css stylesheet write: Code:
h2 { text-indent: 0; text-align: center; font-size: 1.4em; font-weight: bold; margin: 1em 0 2em; } .poem { display: table; margin-left: auto; margin-right: auto; text-align: left; } .stanza { display: table-cell; vertical-align: top; } Code:
<h2>Título del Poema</h2> <div class="poem"> <div class="stanza"> Mi memoria en ti se ocupa<br /> No te olvida un solo instante,<br /> Y mi mente delirante En ti piensa,<br /> en ti piensa sin cesar. </div> </div> Regards Rubén |
|
09-15-2013, 02:09 AM | #9 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Basically that is what I said.... BTW, margin: auto does not work on ADE based readers. You need to create a margin manually.
|
09-15-2013, 05:29 AM | #10 |
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
The problem here is that you need to have a container whose width adapts to its contents. Normal block elements (<p>, <div>) are no good, it is their contents that adapt to their width, and no the other way around. But tables behave like that, so you you could use Rubén's trick with "display:table" (though I'm not sure how that interacts with long lines).
However, when it comes to centering such an element, you need to use "auto" margins. "align:center" does not work, because it controls the alignment of whatever is inside, not the positioning of the element itself. "align:center" in the parent element does not work either, because the table is a block-like element, which does not obey the align attribute. And this is when we find that "auto" margins are explicitly optional in the ePub specification, and ADE choses to ignore them (or rather set them to 0). I'm afraid there's no solution for this. |
09-15-2013, 07:10 AM | #11 | |
Wizard
Posts: 1,529
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
EDIT: Pero creo que no hay que preocuparse mucho Jellby porque si los lectores basados en ADE quieren permanecer competitivos frente a Kindle, van a tener que mejorar su soporte para css ya que hoy por hoy el lector de Amazon les está sacando cada vez más ventajas en ese campo. Así que creo que pronto Nook, Sony y otros van a darle soporte a esas propiedades que estoy utilizando. Last edited by RbnJrg; 09-15-2013 at 08:32 AM. |
|
09-15-2013, 09:59 AM | #12 | ||
frumious Bandersnatch
Posts: 7,514
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
The bottom line, anyway, is that the solution is not guaranteed to work in an ePub, and not because readers are buggy, but because of what the ePub spec says. Quote:
I wish I could be as optimistic as you are, but experience has shown me that I should never expect things to improve in the way I'd like them to. In all these years I haven't seen any significant development in ADE-based readers, except some hyphenation and ligatures support. Old limitations are still there, and I don't see any reader vendor is interested in changing that (Bookeen once looked as if they were, but that was then). Any future "improvement", I'm afraid, will be in the way of bells and whistles, animations, facebook and one-touch buying, and not in better CSS support, spec compliance or layout control (for the user). |
||
09-15-2013, 03:38 PM | #13 | ||
Grand Sorcerer
Posts: 5,582
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
In many ways the current Kindle devices offer more layout features than ADE-based devices. And, as your many posts in the Known ADE bugs forum show, you of all people should be fully aware of the many bugs and limitations in ADE. IMHO, Adobe just got lucky, because nobody else bothered to develop competing DRM solutions and most ereader manufacturers need to buy an RMDSK license for DRM support alone. Quote:
And since the solution suggested by RbnJrg will already work on two different "ecosystems" (iBooks and Kindle/KF8) I fail to see why he shouldn't post them here just because purists insist on Kindles not being "real" ePub2 readers. @RbnJrg: Keep your often innovative solutions coming. |
||
09-15-2013, 03:52 PM | #14 |
Wizard
Posts: 1,529
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
09-15-2013, 08:02 PM | #15 |
Grand Sorcerer
Posts: 11,306
Karma: 43993832
Join Date: Feb 2010
Location: Monroe Wisconsin
Device: K3, Kindle Paperwhite, Calibre, and Mobipocket for Pc (netbook)
|
Select all of the text in your sigil document and then choose the option under the paragraphs alignment that centers text. That should do it.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Another dumb question. | kamanza | Sigil | 5 | 07-12-2012 02:11 PM |
Dumb Question | Pomtroll | Sony Reader | 6 | 10-07-2011 03:14 PM |
Dumb Question, but... | omro | Astak EZReader | 6 | 12-04-2009 04:32 PM |
Unutterably Silly There is never a dumb question, only dumb people! | Dr. Drib | Lounge | 17 | 12-29-2008 09:43 AM |
really dumb question | ernietd | Kindle Formats | 2 | 11-01-2008 12:31 AM |