Thread: Image upscale
View Single Post
Old 09-13-2023, 11:02 AM   #4
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,361
Karma: 20212223
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I use something similar. I’ll set the % of the screen I want to use but also limit the maximum to roughly the size of the images dimension. This helps a lot to prevent over-expanding the image and making it fuzzy.

Code:
CSS:
img     {max-height:100%; max-width:100%}
div.image {width:50%; margin:1em auto}
div.image img {max-width:600px}

HTML:
<div class="image"><img alt="" src="../Images/test.jpg"/></div>

**set to the actual dimension of the image. 
Turtle91 is offline   Reply With Quote