Skip to content

Instantly share code, notes, and snippets.

@jamesmehorter
Created July 9, 2014 19:51
Show Gist options
  • Save jamesmehorter/3504059943f06653de94 to your computer and use it in GitHub Desktop.
Save jamesmehorter/3504059943f06653de94 to your computer and use it in GitHub Desktop.
Full screen background image(s) -- could be a slideshow
//The slideshow container is positioned below all other content to display like a background image
section.backgrounds {
position: absolute ;
z-index: 0 ;
top: 0 ; left: 0 ;
width: 100% ; height: 100% ;
overflow: hidden !important ; //This keeps the 200% dimensions used below in check and not showing scroll bars
figure.background {
//The following trick is used to display the slideshow slides at the full-width of the screen
//This effect looks just like using background-size: cover ; but is supported by older browsers
position: absolute !important ;
z-index: 0 ;
top: -50% !important ; left: -50% !important ;
width: 200% ; height: 200% ;
img {
position: absolute ;
z-index: 0 ;
top: 0 ; bottom: 0 ; left: 0 ; right: 0 ;
margin: auto ;
min-width: 50% ; min-height: 50% ;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment