Last active
December 14, 2015 23:39
-
-
Save ashleygwilliams/5167348 to your computer and use it in GitHub Desktop.
how to style multiple background images on an element
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
/* assuming you have images named background1.jpg, background2.jpg in your assets/images folder | |
set a height so that the image can be seen using 'height' | |
'background-image' takes url(path/to/image.ext), url(path/to/image.ext) .. as many as you want | |
MDN entry: https://developer.mozilla.org/en-US/docs/CSS/background-image | |
'background-position' takes url(path/to/image.ext), url(path/to/image.ext) .. as many as you want | |
MDN entry: https://developer.mozilla.org/en-US/docs/CSS/background-position */ | |
.container { | |
height: 250px; /* make this the height of the image */ | |
background-image: url(/assets/images/background1.jpg), url(/assets/images/background2.jpg); | |
background-position: center bottom, left top; /* you can position each image, separated by a comma */ | |
background-repeat: no-repeat, repeat; /*you can choose to repeat each image too, separated by a comma */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
do i put this in the new custom.css file?