Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 06-02-2009, 02:33 PM   #1
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,143
Karma: 4792399
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Unsetting properties in CSS

Hi all,

I have a feeling this can't be done, but I thought I'd ask anyway. The problem comes when trying to format drop caps and there is some punctuation before the drop cap, as in:

«¡Bendito sea el poderoso Alá!»

where only the B should be a real "drop cap", but the previous content should remain there, before the B.

With the usual code, the drop cap is set as "float", and the punctuation has to be inside the float if it has to keep its place, but only the B has to be big, bold, with a special font or whatever, so the code is something like this:

Code:
<p><span class="drop"><span class="predrop">«¡</span>B</span>endito sea el poderoso Alá!»
Now, I know how to "cancel" some settings I could use for ".drop" so that they don't affect ".predrop". If one has "font-weight:bold", then the other has "font-weight:normal"; "font-size:400%" is cancelled by "font-size:25%", etc. But how can I cancel "font-family:my_custom_font"? The most I can get is using "font-family:serif", but that's not good enough, because there's no guarantee the user has a default serif font, and I don't want to force it...

I wish I could use "font-family:default", or have a selector that targets only ".drop" but not its descendants, or inherit from the grandparent, or something else. Any ideas?

Last edited by Jellby; 06-02-2009 at 02:36 PM.
Jellby is online now   Reply With Quote
Old 06-02-2009, 02:41 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,912
Karma: 5035037
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
AFAIK, the user is guaranteed to have default serif, sansserif, monospace, cursive and fantasy fonts.
kovidgoyal is offline   Reply With Quote
 
Enthusiast
Old 06-03-2009, 04:29 AM   #3
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 6,143
Karma: 4792399
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
AFAIK, the user is guaranteed to have default serif, sansserif, monospace, cursive and fantasy fonts.
Maybe I didn't explain myself. I mean I don't want to force "serif" for the ".predrop", since the user (or the reader) might have "sans-serif" as the default font, and likewise for any other font selection command. I want the "font-family" property to be whatever-default-applies-for-this-user-and-system.

I guess I could do something like:

Quote:
<span class="drop"><span class="predrop">«¡</span><span class="cap">B</span></span>
and just

Code:
<span class="drop cap">B</span>
for the simple cases. I'll have to try this.
Jellby is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some CSS properties not transferring when converting ePub to LRF megacoupe Calibre 2 10-15-2010 05:35 PM
Adding properties to books IzzyMad Workshop 3 10-15-2010 11:05 AM
Editing filenames and properties on the Cybook brudigia Calibre 5 05-01-2009 08:08 AM
Supported HTML/CSS tags and properties Jellby Bookeen 9 05-04-2008 04:55 PM
Changing pdf properties Puddytat purr PDF 2 02-22-2008 09:27 AM


All times are GMT -4. The time now is 07:40 AM.


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