Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 11-19-2013, 11:08 PM   #1
AuthorGreg
Connoisseur
AuthorGreg began at the beginning.
 
Posts: 61
Karma: 10
Join Date: Jul 2012
Device: Nook Simple Touch, Kindle 2nd Gen, Kindle 7" Fire HD
General Sibling Selector

I just discovered that using a general sibling selector doesn't work for ePubs, at least not in ADE. My code was this:

Code:
h1  ~ p {
    font-size: 1.3em;
    margin-top: 1em;
    font-style: italic;
    text-indent: 0;
    text-align: center;
}
That, I suppose, is only supported in CSS3. And therefore not valid in ePub 2.0? It passed validation, but again, ADE didn't render it.

Thanks,

Greg
AuthorGreg is offline   Reply With Quote
Old 11-20-2013, 01:37 AM   #2
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 3,221
Karma: 35037583
Join Date: May 2011
Location: PA {back in the usa!}
Device: Sony PRS-T2, ADE on PC
If you want only the first paragraph after h1 to have this styling, get rid of the tilde and use the plus sign. Just use:
Code:
h1 +p {
    font-size: 1.3em;
    margin-top: 1em;
    font-style: italic;
    text-indent: 0;
    text-align: center;
}
The plus sign can be used to style siblings for styled paragraphs, divs, blockquotes, etc. I have one frequently used one that looks like this:
Code:
.ind0,
.scndrop,
.scnbrk +p, 
h2 +p,
h3 +p,
div.qnote p {
text-indent: 0em;
}
The ones with the "+" style the first paragraph that *follows* that tag. The last one listed, div.qnote p with no "+", styles all the paragraphs *inside* that div.

As far as I know, it is valid in epub2, and is supported very widely in devices and software.
GrannyGrump is offline   Reply With Quote
Advert
Old 11-20-2013, 02:31 AM   #3
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Since it is a CSS3 selector, it will definetly not work. Ones that work are:
<element> <element>
<element>, <element>
<element> + <element>

Perhaps more, but those in any case.
Toxaris is offline   Reply With Quote
Old 11-20-2013, 03:36 PM   #4
AuthorGreg
Connoisseur
AuthorGreg began at the beginning.
 
Posts: 61
Karma: 10
Join Date: Jul 2012
Device: Nook Simple Touch, Kindle 2nd Gen, Kindle 7" Fire HD
I just did a div id on it instead. Too bad we can't use all the nifty tag selectors of CSS3. Well, not yet anyway....
AuthorGreg is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
:first-letter selector support in KF8 Doitsu Kindle Formats 42 09-21-2013 05:49 AM
New YA Hockey Novel Classic for $2.99 - Sports & Sibling Rivalry stacyj Self-Promotions by Authors and Publishers 6 12-09-2011 12:36 PM
Classic Nook crashes on epub with css * selector. aarcane Barnes & Noble NOOK 3 10-08-2010 04:17 PM
Cool Reader and key 9 in Hyphenation language selector CPatrick OpenInkpot 6 04-19-2010 09:02 AM


All times are GMT -4. The time now is 07:47 PM.


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