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 CSS Basics (2014) Basic Layout Backgrounds: Size and Position

Jose L. Camacho
Jose L. Camacho
4,972 Points

When you are making a background shorthand do the values have to be in a specific order ?

Such as

background: (color) (image-location) (position) (repeat) (size)

also what do the forward slashes do?

charlotte22
charlotte22
1,209 Points

Hi there, the order is:

background-color
background-image
background-repeat
background-attachment
background-position

e.g. background: #ff00ff url("image.jpg") no-repeat top

2 Answers

Keith Corona
Keith Corona
9,553 Points

What happens if one of the values is missing, for example, image?