<h1>Complex Background Patterns</h1>
<div class="item">
<p class="title">tablecloth pattern</p>
<div class="container tablecloth">
</div>
</div>
<div class="item">
<p class="title">blueprint pattern</p>
<div class="container blueprint">
</div>
</div>
<div class="item">
<p class="title">advanced blueprint pattern</p>
<div class="container advanced">
</div>
</div>
<div class="item">
<p class="title">polka dot pattern</p>
<div class="container dot">
</div>
</div>
<div class="item">
<p class="title">checkerboards pattern</p>
<div class="container checkerboards">
</div>
</div>
html, body {
min-height: 100%;
}
body {
background-color: #ffdfc3;
padding: 2em;
font-family: palatino;
}
h1 {
text-align: center;
font-size: 500%;
color: #ca133f;
text-shadow: 0 2px white;
}
.item {
display: flex;
flex-direction: column;
align-items: center;
margin: 2em 0;
}
.title {
font-size: 2.8em;
color: #9c6a4f;
text-shadow: 0 2px white;
}
.container {
width: 800px;
height: 200px;
box-shadow: 2px 2px 5px 0 hsla(0,0%,0%,.4);
border-radius: 1em;
background-color: white;
}
.tablecloth {
background: white;
background-image:
linear-gradient(90deg, rgba(200,0,0,.5) 50%, transparent 0),
linear-gradient(rgba(200,0,0,.5) 50%, transparent 0);
background-size: 30px 30px;
}
.blueprint {
background: #58a;
background-image:
linear-gradient(white 1px, transparent 0),
linear-gradient(to right, white 1px, transparent 0);
background-size: 30px 30px;
}
.advanced {
background: #58a;
background-image:
linear-gradient(white 2px, transparent 0),
linear-gradient(90deg, white 2px, transparent 0),
linear-gradient(hsla(0,0%,100%,.3) 1px, transparent 0),
linear-gradient(90deg, hsla(0,0%,100%,.3) 1px, transparent 0);
background-size:
75px 75px,
75px 75px,
15px 15px,
15px 15px;
}
.dot {
background: #655;
background-image:
radial-gradient(tan 30%, transparent 0),
radial-gradient(tan 30%, transparent 0);
background-size: 30px 30px;
background-position: 0 0, 15px 15px;
}
.checkerboards {
background: #eee;
background-image:
linear-gradient(45deg, #bbb 25%, transparent 0),
linear-gradient(45deg, transparent 75%, #bbb 0),
linear-gradient(45deg, #bbb 25%, transparent 0),
linear-gradient(45deg, transparent 75%, #bbb 0);
background-position: 0 0, 15px 15px, 15px 15px, 30px 30px;
background-size: 30px 30px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.