<section class="example">
<div class="container">
<css-doodle>
:doodle {
@grid: 10 / 100vmax;
background: midnightblue;
}
@shape: cross;
background: hsla(
calc(300 - @index() * 5),
60%, 70%, @rand(.8)
);
transform:
scale(@rand(.2, 1.2))
translate(
@rand(-50%, 50%), @rand(-20%, 20%)
);
</css-doodle>
</div>
<div class="sample-content">
<h1>CSS-Doodle Background</h1>
</div>
</section>
.example {
position: relative;
width: 100vw;
height: 100vh;
overflow: hidden;
}
.sample-content {
position: absolute;
top: 50%;
left: 50%;
width: 80%;
background: rgba(255,255,255,0.85);
transform: translate3d(-50%, -50%, 0);
padding: 30px;
}
@media (min-width:600px) {
.sample-content {
width: 30%;
}
}
.sample-content h1 {
margin: 0;
text-align: center;
}
This Pen doesn't use any external CSS resources.