<p>Flapjacks on a <a href="#">sunny warm</a> afternoon.</p>
:root {
--mainColor: #ff9800;
}
body {
align-items: center;
background-color: #0E0F11;
color: #fff;
display: grid;
font-family: 'Montserrat', sans-serif;
font-size: 2em;
height: 100vh;
overflow: hidden;
}
p {
grid-column: 2;
}
a {
color: var(--mainColor);
text-decoration: none;
}
a::before {
content: '';
background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/9632/chris.jpg');
background-position: 0 30%;
background-repeat: no-repeat;
background-size: 100%;
height: 100vh;
left: 0;
position: absolute;
bottom: 0vh;
width: 100vw;
transform: translateY(100%);
transition: transform .3s;
}
a:hover::before {
transform: translateY(0px);
}
@media screen and (min-width: 500px) {
body {
grid-template-columns: 250px 2fr .5em;
}
a::before {
background-position: 0;
background-size: 250px;
height: 200px;
transform: translateY(200px);
}
}
@media screen and (min-width: 700px) {
body {
grid-template-columns: 350px 2fr 15px;
}
a::before {
background-size: 300px;
height: 250px;
transform: translateY(250px);
}
}
@media screen and (min-width: 1200px) {
body {
display: flex;
justify-content: center;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.