07-30-2009, 02:12 AM | #1 |
Wizard
Posts: 1,165
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
|
IMG css override not working anymore?
Hi, I've upgraded to 6.0 and this code no longer works? I've entered into the Look and Feel Extra CSS section.
img {text-align: center;} |
07-30-2009, 01:12 PM | #2 |
creator of calibre
Posts: 44,562
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
What is your output format?
|
Advert | |
|
07-30-2009, 01:37 PM | #3 |
Wizard
Posts: 1,165
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
|
|
07-30-2009, 02:57 PM | #4 |
creator of calibre
Posts: 44,562
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Hmm, it may have broken. Open a ticket and attach your HTML file.
|
07-30-2009, 03:53 PM | #5 |
Wizard
Posts: 1,165
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
|
I'll test it one more time at home because I remembered sometimes turning off the program and restarting it sometimes helps the settings work. But yes, if the problem persists I'll open a ticket. I ended up eventually just adding the <p align="center"> to the image file and that worked. But I'd like to move away from adding more code to the html file if possible.
|
Advert | |
|
07-31-2009, 06:49 AM | #6 | |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
That would mean, AFAIK, that whatever inside the <img> will be centered in the <img>, but the <img> has no content, it is content itself, what you need is adding "text-align: center" to the parent element, <div>, <p> or whatever, so that the <img> is centered inside it. Similarly, adding "text-align: center" to a <table> does not center the table on the page, but it centers the text inside the table cells. |
|
07-31-2009, 02:29 PM | #7 | |
Wizard
Posts: 1,165
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
|
Quote:
and the css override would center the image. Not sure if it's supposed to work or not but it did before. Still need to test this again. I had some deadlines for converting this week so I was using 5.13 on my other computer. |
|
08-01-2009, 06:27 AM | #8 |
Banned
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
|
Try this:
Code:
img { display: block; margin-left: auto; margin-right: auto } m a r |
08-02-2009, 11:25 PM | #9 |
Wizard
Posts: 1,165
Karma: 32196
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
|
|
08-03-2009, 01:17 AM | #10 |
Guru
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
|
That results in invalid (X)HTML, though - IMG is an inline element, it can't exist outside a block element. A standard-conforming reader should refuse to render it.
|
08-03-2009, 02:12 AM | #11 | |
Banned
Posts: 475
Karma: 796
Join Date: Sep 2008
Location: Honolulu
Device: Nokia 770 (fbreader)
|
Quote:
m a r |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Embedding Chinese font using CSS override? | kome17 | Calibre | 0 | 09-18-2009 01:57 AM |
css override code for margins? | Amalthia | Calibre | 15 | 08-11-2009 08:20 PM |
help with Claibre CSS override | sideburnt | Calibre | 7 | 05-28-2009 09:25 PM |
centering images with css override? | Amalthia | Calibre | 2 | 03-30-2009 02:53 PM |
css override code for <h2> and <h1> tags | Amalthia | Calibre | 2 | 03-29-2009 07:51 PM |