Created
December 2, 2015 21:23
-
-
Save tannerhodges/619ac5810ac8672c22dd to your computer and use it in GitHub Desktop.
BJGG: Scale and crop tall background images for smaller screens
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
/* Scale and crop tall background images for smaller screens */ | |
@media (max-width: 767px) { | |
.opening.homepage .row { | |
background-image: none; | |
} | |
.opening.homepage .mt { | |
height: auto; | |
padding: 0 0 90%; /* Lower this value as the image gets too tall */ | |
background-image: url("http://stg-bjgg.cottontest.com/resources/~style/../%7Eimg/home/Home-opening-750x700.jpg"); | |
background-size: 100% auto; | |
background-position: center; /* As you lower the padding, adjust the position to make sure the focal point of the image is still visible */ | |
} | |
} | |
@media (min-width: 520px) and (max-width: 767px) { | |
.opening.homepage .mt { | |
padding: 0 0 60%; | |
background-position: top 10% center; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment