Web Development Kodex

pattern overlay

index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Pattern Overlay</title>
<meta name="robots" content="noindex, nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>Pattern Overlay</h1>
</header>
<div class="wrapper">
<div class="container">
<div class="overlay">
<span></span>
</div>
</div> <!-- .container-->
</div> <!-- .wrapper-->
<footer>
<small><a href="https://opensource.org/licenses/MIT">MIT</a></small>
</footer>
</body>
</html>

styles.css

body {
background: #eeeeee;
font-size: 16px;
font-family: "Trebuchet MS", Helvetica, sans-serif;
margin:0;
}
a {
color:crimson;
text-decoration:none;
}
a:hover {
color:red;
}
/* Layout
------------------------------------------*/
header,
.container,
footer {
margin: 0 auto;
width:88%;
max-width: 1080px;
}
.wrapper {
padding:1em 0;
background: #ffffff;
}
/* Image overlay
------------------------------------------*/
.overlay {
background:url(images/cosmic-thing.jpg) no-repeat;
background-position:50% 50%;
background-size:cover;
max-width:800px;
height:600px;
}
.overlay span {
background:url(images/pattern.png);
width:100%;
height:100%;
display:block;
}