Last active
February 24, 2017 17:37
-
-
Save stphnwlkr/445dbcbb43d61b1c29be6991e4f53dac to your computer and use it in GitHub Desktop.
Random Image for CSS using ColdFusion
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
<cfoutput> | |
<cfscript> | |
imglist = 'bg4.jpg,bg3.jpg,telehealth_hero_1.jpg'; | |
randImg=ArrayNew(1); | |
randImg = listtoarray(imglist,','); | |
bgImg=randImg[RandRange(1,ArrayLen(randImg))]; | |
</cfscript> | |
<style> | |
.hero { | |
padding-top: 3rem; | |
padding-bottom: 3rem; | |
background-image: url("/_media/img/hero/#bgImg#"); | |
background-position: center; | |
background-size: cover; | |
min-height: 400px; | |
} | |
</style> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment