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

background-clip & background-origin seem to do the same thing. What situations would call for one over the other?

background -clip & -origin seem to have the same result. Is there any real difference between the two and if so, what situations would call for the use of one over the other?

Thanks.

2 Answers

Łukasz Karbownik
Łukasz Karbownik
30,003 Points

In short, background-clip allows you to decide whether background is extended into border of the box. Background-origin allows you to choose what is the origin point for left, right, top and bottom properties. In example, you can choose padding-box as an origin point for position properties but background still can extend to the border part of the box if background-clip property allows it.