<h4>Властивість <code>background-repeat</code></h4>
<div class="demo">
<div class="block no"><p>фонове зображення без повторення</p></div>
<div class="block yes"><p> фонове зображення з повторенням</p></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 {
margin-top: 75px;
width: 45vw;
height: 150px;
border: 8px solid #4f4f4f;
font-family: monospace;
font-size: .8em;
color: #000;
background-image: url(https://lorempixel.com/50/50/);
}
.no { background-repeat: no-repeat; }
.yes { background-repeat: repeat; }
.block > p {
position: relative;
top: -75px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.