View Single Post
Old 11-28-2022, 06:24 AM   #22
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
SVG has another drawback for me that I, in my ignorance, have not been able to solve. Imagine you have an image that is wider than high, and you want to display it alone on a page. The best method might be the SVG wrapper, because I think it's the only way to automatically centre the image vertically, as well as ensuring that the aspect ratio is respected.
But if the image has a caption, I have not been able to display it below and close to the picture.
This is what I do:
Code:
  <figure>
    <svg xmlns="http://www.w3.org/2000/svg" 
xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" 
width="100%" height="100%" viewBox="0 0 506 259" 
preserveAspectRatio="xMidYMid meet">
<image width="506" height="259" xlink:href="../Images/17.jpeg"/></svg>

    <figcaption><b>Fig. 17:</b> Paragraph with several lines of text.</figcaption>
  </figure>
If anyone knows how to solve it I would be very grateful.
repilo is offline   Reply With Quote