Thread: Bottom of Page
View Single Post
Old 10-17-2020, 06:29 PM   #8
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,827
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by FDPuthuff View Post
If I am dealing with some front matter and I wish to 'bottom-justify' a few lines of text, is there html, which will do that, or do I add blank lines until I think I may possibly, maybe be at the bottom of the page?
.
.
.
.
Like this stuff here
Assume it's at the bottom of a page
.
And this
Here
It's possible to do what you want. You need to employ a table with three rows, one for the header, one for the body and one for the footer. Of course, only can be used for one page (i.e. a title page).

The following css properties works perfectly under ADE:

Code:
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

div.container {
   height: 95%;
   width: 100%;
}

.full {
   height: 100%;
   width: 100%;
}

.header {
   height: 10%;
   vertical-align: bottom;
   font-size: 14pt;
   background: khaki; /* suppress this */
}

.bdy {
   height: 80%;
   vertical-align: middle;
   font-size: 22pt;
   font-weight: bold;
   background: lightblue; /* suppress this */
}

.footer {
   height: 10%;
   vertical-align: bottom;
   font-size: 12pt;
   background: lightgreen; /* suppress this */
}

.center {
   text-align: center;
   text-indent: 0;
   margin: 0;
}
and the following html text:

Code:
<body>
  <div class="container">
    <table class="full" cellpadding="0" cellspacing="0">
      <tbody class="full">
        <tr>
          <td class="header">
            <p class="center">THIS IS THE HEADER</p>
          </td>
        </tr>

        <tr>
          <td class="bdy">
            <p class="center">THIS CAN BE<br/><big><big>A TITLE</big></big></p>
          </td>
        </tr>

        <tr>
          <td class="footer">
            <p class="center">THIS IS THE FOOTER</p>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</body>
You can see how the code looks in ADE with different font sizes:

Click image for larger version

Name:	Image1.png
Views:	358
Size:	48.1 KB
ID:	182850 Click image for larger version

Name:	Image2.png
Views:	340
Size:	46.2 KB
ID:	182851

I used three colors as background so you can see the layout but you have to erase that property, so the page will look clean. Also take into account that I used "pt" as measurement of font-size. Of that way the layout won't be broken when the user change the font size (all that in ADE). You can open the epub I attach to see how it works in ADE.

Regards
Rubén
Attached Files
File Type: epub Title page for ADE.epub (2.3 KB, 302 views)

Last edited by RbnJrg; 10-17-2020 at 06:35 PM.
RbnJrg is offline   Reply With Quote