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

CSS

Anthony Domina
PLUS
Anthony Domina
Courses Plus Student 19,571 Points

Want to show 3 different images in background, background-repeat causing unnecessary duplication

I have 3 images I want to display in my jumbotron (a giant header). The CSS below displays 3 images side-by-side in the desired format. However the 2nd image is skipped over and the 3rd image is duplicated.

I have played with different combinations of background-repeat and background-position but have not found a way past this.

The second image is recognized because I have removed the middle "no-repeat" shown below and what happens is it shows 1 instance of image 1 and 2 instances of image 2, ignoring the 3rd.

I would be grateful for any insight the community has to help me get this looking nice!

HiroshimaJumbo {

height: 400px; background-image: url('../img/HiroMem1.jpg'), url('../img/HiroMem3.jpg'), url('../img/HiroMem2.jpg'); background-size: 33.3%; background-position: left-center, middle-center, right-center; background-repeat: no-repeat, no-repeat, repeat-x; }

Anthony Domina
Anthony Domina
Courses Plus Student 19,571 Points

I figured it out. This worked beautifully:

HiroshimaJumbo {

height: 400px; background-image: url('../img/HiroMem1.jpg'), url('../img/HiroMem3.jpg'), url('../img/HiroMem2.jpg'); background-size: 33.3%, 33.3%, 33.3%; background-position: 0px 0px, top center, top right; background-repeat: no-repeat; }