<h4>Властивість <code>background-clip</code></h4>

<div class="demo">
	<div class="block pad"><span>padding-box</span></div>
	<div class="block bor"><span>border-box</span></div>
	<div class="block con"><span>content-box</span></div>
</div>
* {
	box-sizing: border-box;
}
	
body {
	font-family: sans-serif;
	line-height: 1.45;
	font-size: 18px;
	padding: 16px 16px 0 16px;
	text-align: center;
}

h4 {
	color: #4f4f4f;
	font-weight: 400;
}

.demo {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.block {
	background: url(https://lorempixel.com/175/175/);
	background-repeat: no-repeat;
	background-size: cover;
	width: 175px;
	height: 175px;
	border: 12px solid rgba(0, 0, 0, .15);
	margin-top: 46px;
	padding: 12px;
}

.block > span {
	position: relative;
	top: -55px;
	font-family: monospace;
	font-size: .9em;
	font-weight: 700;
	color: #4f4f4f;
}

.pad { background-clip: padding-box; }
.bor { 
	background-clip: border-box;
	background-origin: border-box;
}
.con { background-clip: content-box; }

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.