|  04-26-2009, 10:56 AM | #1 | 
| eBook Enthusiast            Posts: 85,560 Karma: 93980341 Join Date: Nov 2006 Location: UK Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6 | 
				
				Line indents using "<div>" tags
			 
			
			Book Designer, my preferred tool for creating books, produces HTML that uses <div> rather than <p> to define paragraphs. I know that there are Mobi-specific parameters that one can add to a <p> tag to define the indentation of the line, but is there any equivalent (eg inline CSS) that can be used to achieve the same thing with a <div> tag? My aim here is to be able to specify additional indentation for specific lines of poetry. Thanks! | 
|   |   | 
|  04-26-2009, 11:45 AM | #2 | 
| Sir Penguin of Edinburgh            Posts: 12,375 Karma: 23555235 Join Date: Apr 2007 Location: DC Metro area Device: Shake a stick plus 1 | 
			
			Here are 2 examples of the div tag that I got from Mobipocket. The style attribute works even though it's not listed as supported attribute. <div style="border: 1px solid black; background-color: gray;"> </div> <div align="center" bgcolor="#FFEBD6"> </div> Here is a link to info on the div tag (not all will work in Mobipocket): http://www.w3schools.com/tags/tag_DIV.asp I think it might be best to put each line of poetry in its own set of tags. If you need more indentation, I would recommend using   (the non breaking space character). This will adjust better when changing the font size. | 
|   |   | 
| Advert | |
|  | 
|  04-26-2009, 11:54 AM | #3 | 
| Resident Curmudgeon            Posts: 80,746 Karma: 150249619 Join Date: Nov 2006 Location: Roslindale, Massachusetts Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 | 
			
			Create the CSS and use <div class="classname">text</div>
		 | 
|   |   | 
|  04-26-2009, 12:01 PM | #4 | 
| Sir Penguin of Edinburgh            Posts: 12,375 Karma: 23555235 Join Date: Apr 2007 Location: DC Metro area Device: Shake a stick plus 1 | 
			
			I'd also recommend that you not try anything too complicated. Tag support is hit or miss in Mobipocket-particularly the older versions.  I'd be willing to test it for you if you want. | 
|   |   | 
|  04-26-2009, 12:05 PM | #5 | 
| Resident Curmudgeon            Posts: 80,746 Karma: 150249619 Join Date: Nov 2006 Location: Roslindale, Massachusetts Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 | 
			
			Mobipocket Creator (publisher edition) will convert the CSS and tags into it's normal mess.
		 | 
|   |   | 
| Advert | |
|  | 
|  04-26-2009, 12:07 PM | #6 | 
| Sir Penguin of Edinburgh            Posts: 12,375 Karma: 23555235 Join Date: Apr 2007 Location: DC Metro area Device: Shake a stick plus 1 | |
|   |   | 
|  04-26-2009, 12:38 PM | #7 | |
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | Quote: 
 Personally, I use <p> for poetry lines (as for normal paragraphs). For each line I have <p height="0em" width="2em">, and I change the 0 and 2 if needed. | |
|   |   | 
|  04-27-2009, 02:26 AM | #8 | 
| eBook Enthusiast            Posts: 85,560 Karma: 93980341 Join Date: Nov 2006 Location: UK Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6 | 
			
			Thanks to all for the suggestions. Presumably it would be best to use an "em" spacing, since this should scale with the font size, whereas "px" or "pt" won't? I'll do some experiments and see what works best. | 
|   |   | 
|  04-27-2009, 03:07 AM | #9 | 
| eBook Enthusiast            Posts: 85,560 Karma: 93980341 Join Date: Nov 2006 Location: UK Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6 | 
			
			Using <div width="1em"> works beautifully! Thanks very much for the assistance.
		 | 
|   |   | 
|  04-27-2009, 05:59 AM | #10 | 
| frumious Bandersnatch            Posts: 7,570 Karma: 20150435 Join Date: Jan 2008 Location: Spaniard in Sweden Device: Cybook Orizon, Kobo Aura | 
			
			My pleasure. Now you can get rid of all the   for indents    | 
|   |   | 
|  04-29-2009, 10:10 PM | #11 | 
| GuteBook/Mobi2IMP Creator            Posts: 2,958 Karma: 2530691 Join Date: Dec 2007 Location: Toronto, Canada Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN | |
|   |   | 
|  04-29-2009, 10:18 PM | #12 | 
| Resident Curmudgeon            Posts: 80,746 Karma: 150249619 Join Date: Nov 2006 Location: Roslindale, Massachusetts Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 | 
			
			The eBook I converted to ePub today uses a hanging indent and it works very well. Code: .calibre_class_17 {
    margin-top: 0%;
    text-indent: -3%;
    margin-left: 3%
    } | 
|   |   | 
|  | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Defining Metadata with "calibredb add" command line function. | macr0t0r | Calibre | 3 | 03-01-2012 07:36 PM | 
| How to reduce indents without "removing space between paragraphs" | Skydog | Calibre | 5 | 06-05-2010 12:58 AM | 
| pdf "3rd pass pages" and line numbers | mattgi | Calibre | 1 | 01-26-2010 09:23 PM | 
| "subtree mode" and tags in madshelf - really used? | dottedmag | OpenInkpot | 19 | 06-05-2009 12:10 PM | 
| iLiad "joe" command line text editor | bobj | iRex Developer's Corner | 3 | 06-02-2008 03:03 PM |