|  03-02-2012, 03:44 PM | #1 | 
| Zealot            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? | 
|   |   | 
|  03-02-2012, 04:03 PM | #2 | 
| Grand Sorcerer            Posts: 28,880 Karma: 207000000 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?
		 | 
|   |   | 
|  03-02-2012, 06:48 PM | #3 | 
| Zealot            Posts: 128 Karma: 238654 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.
		 | 
|   |   | 
|  03-03-2012, 03:11 AM | #4 | 
| Zealot            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.
		 | 
|   |   | 
|  03-03-2012, 03:59 AM | #5 | 
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | 
			
			h2 { float: left; } should suffice.
		 | 
|   |   | 
|  03-03-2012, 07:17 AM | #6 | 
| Zealot            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. | 
|   |   | 
|  03-03-2012, 11:55 AM | #7 | 
| Zealot            Posts: 128 Karma: 238654 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;}Last edited by Keroberos; 03-03-2012 at 12:01 PM. | 
|   |   | 
|  03-04-2012, 05:57 AM | #8 | |
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | Quote: 
 But maybe you can get something approximate if you set "line-height: 1; vertical-alignment: top" in the heading. | |
|   |   | 
|  03-04-2012, 06:25 AM | #9 | 
| Zealot            Posts: 121 Karma: 5070 Join Date: Dec 2010 Device: none | |
|   |   | 
|  | 
| 
 | 
|  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 |