Created
August 28, 2017 08:49
-
-
Save Yelakelly/234f6d70ff637efd9ff2bdd0904639b9 to your computer and use it in GitHub Desktop.
Background - center (without transform)
This file contains hidden or 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
img{ | |
position: absolute; | |
/* Position the image in the middle of its container. */ | |
top: -9999px; | |
right: -9999px; | |
bottom: -9999px; | |
left: -9999px; | |
margin: auto; | |
/* The following values determine the exact image behaviour. */ | |
/* You can simulate background-size: cover/contain/etc. | |
by changing between min/max/standard width/height values. | |
These values simulate background-size: cover | |
*/ | |
min-width: 100%; | |
min-height: 100%; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment