Thread: Resizing Images
View Single Post
Old 05-19-2022, 06:42 AM   #1
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,864
Karma: 146918083
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Resizing Images

Quote:
Originally Posted by Gunivortus View Post
Formatting the text works fine, but there are also pictures. I like to get them resized to the screen on which the book is read.
Now, the pictures are small at any device, just take ca. 1/4 of a screen.
How can I get them flexible resized?
Here is the CSS and HTML code that I use to size images to be the full screen keeping the correct aspect ratio.

CSS code:
Code:
body {
  widows: 1;
  orphans: 1;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  text-align: justify;
}
img {
  max-height: 100%;
  max-width: 100%;
}
.cover {
  text-align: center;
  text-indent: 0;
  height: 100%;
}
HTML code:
Code:
<div class="cover"><img alt="" class="cover" scr="../images/image.jpg"></div>
JSWolf is offline