![]() |
#1 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Centering an ornament between paragraphs
I must be a complete idiot! This seems like such a simple thing that I'm trying to do, and yet I can't seem to find a solution that WORKS, neither here in these forums nor anywhere else on the web.
![]() I'm working on a rather long book, and in each chapter there's the occasional instance where there's some extra space inserted between paragraphs/sections. I thought it would be nice to toss a simple ornament/flourish in-between there (long horizontally, thin vertically). The image I'm using is relatively hi-res -- that is, not super-hi-res or anything, but it's big enough that if people felt so inclined, they could double-click on it and see the detail better -- and I've used it as a little flourish underneath all my chapter titles, too. In this latter instance, under the chapter titles, it comes out looking fine, and you don't see anything funny going on -- but that's probably because the distance between the title/ornament and the ornament/first paragraph doesn't have to be symmetrical (and isn't meant to be). When I insert it in-between two paragraphs, though, I can't seem to get it so that the image is nicely centered in-between paragraphs, i.e. that there's just as much space above the ornament as below. It'll look fine in Sigil, but when I view it on my iPad it ends up being too close to the lower paragraph, i.e. there's more of a margin above the image than there is below it. I've tried all kinds of different things, and nothing seems to work! This seems so simple and basic, though -- surely there must be some ridiculously easy way to do this? :/ Last edited by Psymon; 08-16-2014 at 10:24 AM. |
![]() |
![]() |
![]() |
#2 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
If it matters, this is the image that I'm using as an ornament. Underneath my chapter titles I have it set to 62%, and wanted it to be 38% in-between paragraphs (i.e. in-between sections within a chapter, where originally there's some extra blank space) -- and in both cases centered, of course.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
I see no reason a full scale image should cause visual balance issues. |
|
![]() |
![]() |
![]() |
#4 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
|
![]() |
![]() |
![]() |
#5 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Heh, I figured it out! Before, while searching for an answer, I'd been using "center image epub" as my query (and here in these forums I just used "center image"), neither of which seemed to give me a solution that worked. A short while ago, though, I tried searching instead just for "center image css", and that led me to something that does work just perfectly!
I've only tried this out on my iPad so far, but what I ended up using was the following. For my CSS I used... img.ornament { width: 38%; display: block; margin-left: auto; margin-right: auto; margin-top: 0.38em; margin-bottom: 0.38em; } ...and my image tag... <p><img alt="Ornament" class="ornament" src="../Images/ornament-black.jpg" /></p> I tried using "0" for my top/bottom margin, that that only seemed to end up giving me the same issue as before -- i.e. the top margin invariably ended up bigger than the bottom margin (and I have no idea why) -- but just bumping it up a bit seemed to do the trick. I don't quite understand why this works and my earlier experiments didn't, but hey, it works! That's all that matters. ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
|
![]() |
![]() |
![]() |
#7 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Really? I have it in my style sheet in a couple of places, for example with centered paragraphs that I want to keep together as a block, or for tables, so that they'll center as well in the middle of the page "auto(matically)".
So what would one do in a case like that? The width of the thing in question varies from place to place, so it's not like I could just specify a particular percentage or something. |
![]() |
![]() |
![]() |
#8 | ||
frumious Bandersnatch
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,548
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Quote:
Quote:
Code:
<div class="ornament"><img alt="" src="../Images/ornament-black.jpg" /></div> Code:
div.ornament { text-align: center; margin-top: 0.38em; margin-bottom: 0.38em; } div.ornament img { width: 38%; } |
||
![]() |
![]() |
![]() |
#9 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Interesting -- thanks! I changed all those ornaments.
![]() And what about the aforementioned tables, then? Wrap all those in a "text-align: center" div, too, basically? Will that keep the width of the table to a minimum (assuming it's not so "full" with stuff that it stretches to the width of the margins, of course)? I know I can try this out myself and see, but my inability to see what happens on other devices that I can't do, of course. |
![]() |
![]() |
![]() |
#10 | |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
Y'know what? That doesn't work on the iPad. It looks right in Sigil, but when I view it on the iPad the image stretches to 100% (width of the page, and proportionally for the height). :/ |
|
![]() |
![]() |
![]() |
#11 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,741
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#12 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,741
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
AAARRGGHH!!! Please STOP using iPad as a generic term for whatever app you use to read with. The iPad is the device and the app is what you want to mention. You could be using iBooks, Bluefire, Montano (sp?), Marvin, and others.
|
![]() |
![]() |
![]() |
#13 | |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
Quote:
What's the emoticon for "D'oh"? ![]() |
|
![]() |
![]() |
![]() |
#14 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Are you sure you coded the HTML correctly? In iBooks, which is hinky, you can't really reliably center things without ensuring that they are encased in "something else," even if it's as useless as an empty span. Can you drop your HTML in here? Hitch |
|
![]() |
![]() |
![]() |
#15 |
Chief Bohemian Misfit
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 571
Karma: 462964
Join Date: May 2013
Device: iPad, ADE
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Share your favourite Holiday ornament or decoration | 5thWiggle | Lounge | 2 | 12-22-2013 12:40 PM |
PRS-650 What is 'ornament assy' ? | Witty Username | Sony Reader | 7 | 08-27-2011 05:43 PM |
Other Non-Fiction Holmes, William H.: Form and Ornament in Ceramic Art, v.1, 30 Dec 2008 | vivaldirules | IMP Books | 0 | 12-30-2008 08:47 AM |
Other Non-Fiction Holmes, William H.: Form and Ornament in Ceramic Art, v.1, 30 Dec 2008 | vivaldirules | Kindle Books | 0 | 12-30-2008 08:46 AM |
Other Non-Fiction Holmes, William H.: Form and Ornament in Ceramic Art, v.1, 30 Dec 2008 | vivaldirules | BBeB/LRF Books | 0 | 12-30-2008 08:45 AM |