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 trial
Daniel Oropeza
4,432 PointsHow do you add multiple backgrounds to the body?
I'm looking to add three cover size images to the body element. Below each other.
Each image has some layered css. Like the Tahoe website image.
background: linear-gradient(#ffa949, transparent 90%), linear-gradient(0deg, #fff, transparent), #ffa949 url('../img/mountains.jpg') no-repeat center;
1 Answer
Da Bu
3,442 PointsYou can try with this code below.
Multiple images:
body {
background: url(images/image-1.png), url(images/image-2.png),url(images/image-3.png);
background-repeat: no-repeat, repeat-x, repeat-y;
background-position:10px 20px , 20px 30px ,15px 25px;
}
Image + gradient:
body {
background-image: url("images/image-1.png"), linear-gradient(red, yellow);
background-image: url("images/image-1.png"), -webkit-gradient(linear, left top, left bottom, from(red), to(yellow));
background-image: url("images/image-1.png"), -moz-linear-gradient(top, red, yellow);
}
Let me know if this helps.