View Single Post
Old 07-17-2020, 02:33 PM   #3
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,356
Karma: 20171571
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
try this:

Code:
div.image {margin:2em auto}
div.image img {width:50%; max-width:100px}

<div class="image"><img alt="" src="images/ne-logo100.png"/></div>
As jhowell mentioned, the 50% is half your screen width (or half the width of the container)... the max-width tells it to NOT display larger than the actual pixel size of the image 100px so it doesn't get overblown and pixelated.... that alt="images/ne-logo100.png" is actually worse than nothing at all... you can adjust the div.image settings to style it however you wish.

Last edited by Turtle91; 07-18-2020 at 07:56 AM. Reason: Clarification of purpose for 'max-width'
Turtle91 is offline   Reply With Quote