|
|
#1 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 32370
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;} |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,676
Karma: 28549304
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
What is your output format?
|
|
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 32370
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
|
|
|
|
|
|
|
#4 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,676
Karma: 28549304
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Hmm, it may have broken. Open a ticket and attach your HTML file.
|
|
|
|
|
|
#5 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 32370
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.
|
|
|
|
|
|
#6 | |
|
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,571
Karma: 20150435
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. |
|
|
|
|
|
|
#7 | |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 32370
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. |
|
|
|
|
|
|
#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 |
|
|
|
|
|
#9 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,199
Karma: 32370
Join Date: Jan 2007
Location: Anchorage, AK
Device: Sony Reader PRS-505, PRS-650, PRS-T3, Pocketbook HD2
|
|
|
|
|
|
|
#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.
|
|
|
|
|
|
#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 |