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 03-02-2012, 03:44 PM   #1
huebi
Zealot
huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!
 
Posts: 121
Karma: 5070
Join Date: Dec 2010
Device: none
Drop caps

Hi,

drop caps - again. I know the code snippets in the sticky threads here. I'm struggling with chapter numbers, they should be drop caps and <h2> headings at the same time. Any ideas?
huebi is offline   Reply With Quote
Old 03-02-2012, 04:03 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 9,129
Karma: 40942904
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I don't understand. Dropped in relation to what? The chapter title? Do you have an example of what kind of thing you're looking for?
DiapDealer is offline   Reply With Quote
 
Enthusiast
Old 03-02-2012, 06:48 PM   #3
Keroberos
Zealot
Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.
 
Keroberos's Avatar
 
Posts: 127
Karma: 194002
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
Are you trying to get the effect thats shown in the attached image? If so you can do that by using a float.
Attached Thumbnails
Click image for larger version

Name:	Numbers.jpg
Views:	70
Size:	40.6 KB
ID:	83320  
Keroberos is offline   Reply With Quote
Old 03-03-2012, 03:11 AM   #4
huebi
Zealot
huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!
 
Posts: 121
Karma: 5070
Join Date: Dec 2010
Device: none
The example shown by Kerberos is exactly what i want - and the 12 should be a <h2> heading.
huebi is offline   Reply With Quote
Old 03-03-2012, 03:59 AM   #5
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,166
Karma: 4792399
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
h2 { float: left; } should suffice.
Jellby is offline   Reply With Quote
Old 03-03-2012, 07:17 AM   #6
huebi
Zealot
huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!
 
Posts: 121
Karma: 5070
Join Date: Dec 2010
Device: none
Well, thats quire simple, but even with margin and padding set to zero its not really good, how can i raise the 1 a little bit without breaking everything when the user selected a different font size?


i just added border: 1px solid black to exactly see the box. Of course i can adjust the 1 with trial and error, but is there a proper way of aligning the paragraph and the heading vertical?

Last edited by huebi; 03-03-2012 at 02:04 PM.
huebi is offline   Reply With Quote
Old 03-03-2012, 11:55 AM   #7
Keroberos
Zealot
Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.Keroberos can program the VCR without an owner's manual.
 
Keroberos's Avatar
 
Posts: 127
Karma: 194002
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
Were you wanting it to look like this? You can do that with negative margins.

Here's the CSS that I used for <h2>,
Code:
h2 {
float:left;
font-size:3em;
margin:-.3em 0 -.25em 0;}
You can play with the margin values to get the position exactly where you want it.
Attached Thumbnails
Click image for larger version

Name:	Untitled.jpg
Views:	65
Size:	34.2 KB
ID:	83358  

Last edited by Keroberos; 03-03-2012 at 12:01 PM.
Keroberos is offline   Reply With Quote
Old 03-04-2012, 05:57 AM   #8
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,166
Karma: 4792399
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by huebi View Post
Of course i can adjust the 1 with trial and error, but is there a proper way of aligning the paragraph and the heading vertical?
If you want exact alignment, no. Because what you can align is the "bounding box" of the characters, but how much space there is betweet the actual character and its bounding box depends on the font being used, and unless you embed both the heading and normal text fonts (not recommended) you can't know which font is going to be used.

But maybe you can get something approximate if you set "line-height: 1; vertical-alignment: top" in the heading.
Jellby is offline   Reply With Quote
Old 03-04-2012, 06:25 AM   #9
huebi
Zealot
huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!huebi , Klaatu Barada Niktu!
 
Posts: 121
Karma: 5070
Join Date: Dec 2010
Device: none
Quote:
Originally Posted by Jellby View Post
But maybe you can get something approximate if you set "line-height: 1; vertical-alignment: top" in the heading.
Well, this was a big step in the right direction. Thx.
huebi is offline   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
Css Drop Caps does not work in an Epub on a Reader brewt ePub 63 09-07-2012 12:46 AM
The opposite of drop caps LostSock ePub 13 09-13-2011 07:07 AM
small caps yuxi_kelly ePub 20 06-05-2011 12:04 AM
newbiq Q about Drop Caps and Calibre NASCARaddicted Calibre 2 01-14-2010 07:03 PM
css drop caps coming out of calibre brewt Calibre 3 01-18-2009 04:00 PM


All times are GMT -4. The time now is 06:39 AM.


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