<div class="hero-container">
<div class="hero"></div>
<div class="hero-stuff">
<h1>I love coffee</h1>
<a class="btn">Buy Me Some</a>
</div>
</div>
<p>Other content goes down here and doesn't get disturbed by the transitioning hero above it.</p>
.hero-container {
height: 70vh;
width: 100%;
overflow: hidden;
position: relative;
margin-bottom: 20px;
}
.hero {
background: url('https://images.unsplash.com/photo-1467189386127-c4e5e31ee213?auto=format&fit=crop&w=1350&q=80') no-repeat center center;
background-size: cover;
height: 100%;
width: 100%;
padding: 40px;
transition: transform 2s;
}
.hero:hover {
transform: scale(1.15);
}
.hero-stuff {
position: absolute;
top: 40px;
left: 40px;
}
h1 {
font-size: 55px;
font-weight: 700;
font-family: sans-serif;
color: #fff;
}
a.btn {
display: inline-block;
font-family: sans-serif;
font-size: 12px;
font-weight: 700;
letter-spacing: 1.5px;
padding: 11px 30px;
background-color: #636363;
background-image: linear-gradient(to bottom,#636363,#000);
color: #fff;
text-transform: uppercase;
}
a.btn:hover {
background-image: linear-gradient(to bottom,#000,#000);
}
p {
font-family: sans-serif;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.