![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Oct 2014
Device: nexus 7
|
Centering a picture
Hi,
I have a docx file which I have imported into Calibre. There are glifs in it, between sections, and Calibre treats them like text instead of pictures. As a result, the picture is left justified instead of centered on the page. I have tried to change the css without success. Can someone tell me how to do that? <p class="block_8"><img src="images/image1.png" alt="Stag_Head_clip_art_small" class="calibre4"/></p> is what Calibre has written. BLock_8 .block_8 { display: block; font-family: "Times New Roman", serif; font-size: 1.125em; line-height: 1.5; text-align: center; text-indent: 36pt; padding: 0; margin: 6pt 0 0 } Inherited calibre { color: black; display: block; font-family: "Arial", sans-serif; font-size: 1em; padding-left: 0; padding-right: 0; margin: 0 5pt } Thanks |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
From a quick glance it should work fine. On what device/program are you seeing a different result?
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,257
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 21
Karma: 10
Join Date: Feb 2014
Device: Kobo Aura HD, Samsung Note II, Kindle and a few more
|
Just wonder... In .block_8 try either of the following, then both together:
margin: 6pt 0 0 0; (shorthand for margin-top margin-right margin-bottom margin-left) text-indent:0px; (it might entail an offset to the right) So what? |
![]() |
![]() |
![]() |
#5 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 81
Karma: 86158
Join Date: Jan 2011
Location: Maryland
Device: NST, Kindle Fire, iPad2
|
I'm guessing it's the text-indent: 36pt; in .block_8 throwing the alignment off.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Text indent and margin should perhaps move the picture a bit off centre, but not left justified.
|
![]() |
![]() |
![]() |
#7 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,916
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
is this another case of ADE tossing out the CSS and what else you see is just viewer 'default'?
Try adding: Code:
font-weight: bold; |
![]() |
![]() |
![]() |
#8 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,257
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Could be that there is an error in the CSS and ADE is ignore the entire thing.
Post your CSS and someone might see what's going on. |
![]() |
![]() |
![]() |
#9 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
This is where loading it in the editor and using the live css function can help. It will show all the css which applies at this particular point.
|
![]() |
![]() |
![]() |
#10 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,257
Karma: 145488788
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
![]() |
![]() |
![]() |
#11 | |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
(At least, ordinary errors. Who knows if ADE will throw a hissy fit over something totally normal; calibre probably doesn't have a check for every stupid bug ADE has.) |
|
![]() |
![]() |
![]() |
#12 |
Color me gone
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
|
It can also be checked at
http://www.css-validator.org/ to take care of errors in the stylesheet itself. |
![]() |
![]() |
![]() |
#13 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,916
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
My older device has a hissy over some valid CSS3 is in the stylesheet.
We know the rule is to ignore unknown commands. We know in reality it ignore the whole sheet. ![]() |
![]() |
![]() |
![]() |
#14 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Oct 2014
Device: nexus 7
|
|
![]() |
![]() |
![]() |
#15 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Oct 2014
Device: nexus 7
|
I included the css in my original message. I also tried margin:auto and got
.block_8 { display: block; font-family: "Times New Roman", serif; font-size: 1.125em; line-height: 1.5; text-align: center; text-indent: 0; padding: 0; margin: 6pt auto auto in the computed style, margin left and right are 0. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Centering images | perkin5 | Conversion | 8 | 09-19-2014 10:40 AM |
Centering blockquotes | ghostyjack | ePub | 6 | 07-17-2014 06:07 AM |
Nook not centering anything. why? | kateharp | ePub | 0 | 05-11-2011 10:53 PM |
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 |