NoBoTo Posted December 3, 2015 Share Posted December 3, 2015 Good afternoon Can someone explain to me the difference between these properties, please? As for me are one and the same. Regards: Marek Link to comment Share on other sites More sharing options...
ShadowMage Posted December 7, 2015 Share Posted December 7, 2015 Background-clip is used to specify what area of the element will show the background. When set to content-box, for example, the background will only appear in the content-box of that element. If there is padding on the element, the padding will not have a background. By default, this value is set to border-box, meaning the background will extend all the way to the edge of the border. Background-origin is used to specify what part of the background to show in the element. This is used when the image is larger than the element. It is useful for such situations as creating different states of a button (ie, normal vs hover). You could have an image twice the height of the button with both states on it and use the background-origin to determine which state to show. Background-clip limits the area of the element to have a background, while background-origin limits the area of an image to use as a background. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now