View Single Post
Old 11-26-2022, 05:18 AM   #9
repilo
Connoisseur
repilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmosrepilo has become one with the cosmos
 
Posts: 97
Karma: 21870
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
When I want a single image on a page I use the following styles.
To centre the image vertically, depending on its height I use a class that has the appropriate top margin (alone00 for none, alone10 por 10%, etc).
Code:
figure { margin:1em auto; padding:0; text-align:center; }
img { border:0; margin:0; padding:0; width:100%; }
figcaption { 
	margin:0; padding:.4em 0 .3em; text-align:center;
	text-indent:0; font-size:.82em; font-family:sans-serif;
}

figure.alone00 { page-break-before:always; margin-top:0; margin-bottom:0; }
figure.alone10 { page-break-before:always; padding-top:10%; page-break-after:always; }
figure.alone20 { page-break-before:always; padding-top:20%; page-break-after:always; }
Code:
  <p>Text.</p>

  <figure class="alone00">
    <img alt="" src="../images/1.jpg" />

    <figcaption><b>Fig. 1:</b> Text.</figcaption>
  </figure>

  <p>Text.</p>
repilo is offline   Reply With Quote