<section>
<div class="grid__container">
<div class="grid__item" contenteditable="true">This text can be edited by the user.</div>
<div class="grid__item">
<img src="https://picsum.photos/200/100?random=3" alt="">
</div>
<div class="grid__item">YoYo!(^_^).</div>
</section>
@import url("https://fonts.googleapis.com/css2?family=Exo:wght@600&display=swap");
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100vw;
min-height: 100vh;
display: flex;
justify-content: center;
flex-direction: column;
gap: 20px;
font-family: "Exo", Arial, sans-serif;
background-color: #f7f7f7;
padding: 20px;
}
section {
max-width: 90vw;
width: 100%;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
}
.grid__container {
border: 1px dashed #f36;
box-shadow: 0 0 0 6px rgb(0 0 0 / 13%);
border-radius: 1px;
position: relative;
}
.grid__item {
background-color: #f7f7f7;
place-self: center stretch;
color: #f444fff;
}
.grid__item:not(:nth-child(2)) {
padding: 5px;
}
.grid__item:nth-child(1) {
background-color: #f1c2c6;
}
.grid__item:nth-child(2) {
background-color: #dac2f1;
}
.grid__item:nth-child(3) {
background-color: #ccf1c2;
}
.grid__item:nth-child(4) {
background-color: #c2e9f1;
}
.grid__item:nth-child(5) {
background-color: #f1ebc2;
}
.grid__item:nth-child(6) {
background-color: #09f;
}
.grid__item:nth-child(7) {
background-color: #ff5722;
}
.grid__item:nth-child(8) {
background-color: #8bc34a;
}
.grid__item:nth-child(9) {
background-color: #f66803;
}
.grid__item:nth-child(10) {
background-color: #0d815f;
}
.grid__item:nth-child(11) {
background-color: #28d1c2;
}
.grid__item:nth-child(12) {
background-color: #4a28d1;
}
img {
display: block;
}
.grid__container {
display: grid;
grid-template-columns: auto auto auto;
gap: 5px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.