Set the "painting area" of the background to the outside edge of the padding. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Set the "painting area" of the background to the outside edge of the padding.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
div {<!-- www  .j  a v a2s  . c  om-->
    border: 10px dotted black;
    padding: 35px;
    background: pink;
    background-clip: padding-box;
}
</style>
</head>
<body>

<div>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</div>

</body>
</html>

Related Tutorials