Background repeat part 2

Setting the Value to Inherit



When you set the background-repeat property to inherit, it will take the same specified value as the property for the element's parent. 

For example, we set the body background repeat only horizontally. If we set some paragraph background-repeat values to be inherited, they will take the same property value as the body element.

The CSS:
body {
background-image: url("css_logo.png");
background-repeat: repeat-x;
}
p {
background-image: url("css_logo.png");
background-repeat: inherit;
margin-top: 100px;
padding: 40px;
}
Try It Yourself

Result:
Tap Try It Yourself to play around with the code!

Comments

Popular posts from this blog

font-family part 1

Styling the list part 3