Created
November 20, 2021 21:07
-
-
Save justincarlson/4709dee4e54bd1c52598e72691d93daa to your computer and use it in GitHub Desktop.
Sudo Overlay mode HTML so srcset can be used.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="image-wrapper"> | |
<div class="image-container"> | |
<img src="https://www.tyndellphotographic.com/assets/images/products-large/8844cf7c81c27a17ab0d721d38b4aeff.jpg" alt="Sample image"> | |
</div> | |
</div> | |
<style type="text/css"> | |
.image-wrapper { | |
background-color: #fff; | |
height: 500px; | |
width: 500px; | |
border:1px solid red; | |
} | |
.image-container { | |
text-align: center; | |
line-height: 500px; | |
height: 100%; | |
} | |
.image-container img { | |
max-width: 100%; | |
max-height: 100%; | |
width: auto; | |
height: auto; | |
vertical-align: middle; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment