04-09-2009, 11:52 AM | #1 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Centering and adjusting the width of a block
Hi all,
This is more about CSS than ePUB, but I want it to work in ePUB readers, so I guess I can ask here anyway. The thing is I have the chapter titles in an ePUB defiened just with <h1>Chapter 1</h1>, and want them to appear horizontally centered and with a line below that extends a bit (say 1em) left and right. What rules could I use in the CSS for h1 {} ? Let's see: Code:
text-align: center; border-width 0 0 2px 0; Code:
text-align: center; border-width 0 0 2px 0; margin: 0 1em 0 1em; Code:
text-align: center; border-width 0 0 2px 0; padding: 0 1em 0 1em; display: inline; At the end I found this to work in the browser: Code:
border-width 0 0 2px 0; margin: auto; padding: 0 1em 0 1em; display: table; Does anyone have any solution? (and no, text-decoration: underline is no solution for this ) |
04-09-2009, 12:05 PM | #2 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
wrap the text inside <h1> in a <span> and use border on that
|
Advert | |
|
04-09-2009, 12:28 PM | #3 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
|
04-09-2009, 12:38 PM | #4 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use text-decoration: underline
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centering PDF | nguirado | Amazon Kindle | 5 | 10-04-2010 08:45 PM |
How to do centering | sjohnson717 | Calibre | 15 | 02-28-2010 09:20 AM |
Tools for adjusting ePub for specifi readers? | tompe | ePub | 10 | 12-30-2009 03:26 PM |
Help adjusting line size, please. | Stitchawl | Calibre | 4 | 04-05-2009 10:53 PM |