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

<div class="demo">
	<div class="block hex">колір</div>
	<div class="block image">зображення</div>
	<div class="block gradient">градієнт</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: #000;
	width: 150px;
	height: 150px;
	border: 8px solid #4f4f4f;
	font-family: monospace;
	line-height: 150px;
	font-size: .8em;
	color: #fff;
}

.hex { background: #32321A; }
.image { background: url(https://lorempixel.com/150/150/); }
.gradient { background: linear-gradient(#4DAB6B, #FFC50F); }

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.