Web Development Kodex

filters

index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Filters</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>Filters</h1>
</header>
<div class="wrapper">
<div class="container">
<img class="grayscale" src="images/who-shot-the-painter.jpg" alt="who shot the painter"/>
<img class="blur" src="images/who-shot-the-painter.jpg" alt="who shot the painter"/>
<img class="sepia" src="images/who-shot-the-painter.jpg" alt="who shot the painter"/>
</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;
}
/* Filters
------------------------------------------*/
.grayscale {
filter: grayscale(100%);
transition: 1s;
}
.grayscale:hover {
filter: grayscale(0);
}
.blur {
filter: blur(3px);
transition: 1s;
}
.blur:hover {
filter: blur(0px);
}
.sepia {
filter: sepia(100%);
transition: 1s;
}
.sepia:hover {
filter: sepia(0);
}