<div style="position:relative; width: 100%; aspect-ratio:1; display:block; overflow:hidden;">
<img src="blah" style="height: 100%; width:auto; position: absolute; left: 50%; top: 50%; transform:translate(-50%,-50%)"/>
</div>
Created
November 21, 2023 15:48
-
-
Save DominicWatts/3285b65291058d5449d33a47efbf4f98 to your computer and use it in GitHub Desktop.
center-align-image-in-container
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment