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

Could somebody help me to align some Sprites please?

Hi all,

I'm working on a project, from which I've included an excerpt in workspaces (https://w.trhou.se/f4azkabhxt), and I need to align each of the individual sprites that I have here so that they're all aligned to the word 'useful' in the first logo (really useful products). Is there any way that I could do this using CSS?

Thanks everyone.

2 Answers

Hi all.

In the end what I did was turned the .marquee div into a flex container and used align-content to align everything from the center line. Then it was a case of fine tuning one of the brand divs so that it would appear in the right place.

Chris Hall
seal-mask
.a{fill-rule:evenodd;}techdegree
Chris Hall
Full Stack JavaScript Techdegree Student 11,442 Points

You can do this with the background-position: CSS property. You will need to know the horizontal and vertical position of the section of the sprite sheet you want to use. Remember to set the background size or the size of the container to that of the section of the sprite sheet you want to use.

More info on background-position from MDN.