View Single Post
Old 10-15-2012, 12:17 PM   #7
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,560
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Caleń0 View Post
However, I tried this solution and my image, which used to be centered, now has aligned itself to the left. I assume this is because I had created a style for the img tag in the stylesheet:
Code:
img.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
but since I am not using the img tag, but an H1, it no longer stays centered. Do I need to create a center "rule" for it to obey, or is there any other way to keep this image centered, and still use the h1 tag?
Let's see... first, while you can use auto-margins to center the image, it will not work in ADE and it's unneeded, since an <img> must be in some container anyway. So, instead of <img class="center" ... />, I'd use:

Code:
<div class="center"><img ... /></div>
with simply:

Code:
div.center { text-align: center }
That's for a normal image, for the title page I'd use:

Code:
<h1 class="title" title="Title Page"><img ... /></h1>
with:

Code:
h1.title { margin: 0; padding: 0; text-align: center }
(to override the possibly different settings you might have for other <h1> tags)

In any case, this is only to have Sigil automatically add the title page to the TOC. But if you can (and are willing to) manually edit the NCX file, you can always add a link to anywhere without adding an <h1> or any other trick.
Jellby is offline   Reply With Quote