Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKavan Bahrami
8,475 PointsUsing 1x / 2x image sizes in css through background-image : image-set
Hi.
I'm creating a full-screen background image for a header but having some issues with firefox. As of now it works for both iOS and web via Chrome / Safari..
I don't know if I'm missing something small but I can't get it to work. When I use the firefox web browser the hero image doesn't load.
<section id="hero">.. titles buttons etc ...</section>
#hero {
background-repeat: no-repeat;
background-attachment: scroll;
background-position: center right;
background-size: cover;
align-content: center;
background-image:
-webkit-image-set (
url("/img/tribe_s-1x.jpg") 1x,
url("/img/tribe_s-2x.jpg") 2x );
}
any quick thoughts Nick Pettit ?
1 Answer
Kavan Bahrami
8,475 Pointsafter posting i saw that image-set isn't supported by firefox (or ie, but who cares) http://caniuse.com/#search=image-set
:/
Any suggestions on how to do what I want in a more supported way? I'm going to keep looking around.
I'm thinking of just doubling down.. though it's not very clean :
background-image: url("/img/tribe_s-1x.jpg");
background-image: -webkit-image-set (url("/img/tribe_s-1x.jpg") 1x, url("/img/tribe_s-2x.jpg") 2x );