<div id="description">
<h2>Приклад 2</h2>
<p>Кожен квадрат має заданий фоновий колір за допомогою rgb().</p>
</div>
<div id="result">
<div class="square"></div>
<div class="square custom-color"></div>
</div>
#description {
font-style: italic;
text-align: center;
line-height: 1.5;
margin-bottom: 50px;
padding: 12px 16px;
background-color: #f7f7f7;
border: 1px solid #ccc;
}
#result {
display: flex;
justify-content: center;
}
.square {
width: 200px;
height: 200px;
display: inline-block;
}
.square:not(.custom-color) {
background-color: rgb(0, 0, 255);
}
.square.custom-color {
background-color: rgb(255, 0, 0);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.