View Single Post
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: 7,516
Karma: 18512745
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 offline   Reply With Quote