Skip to content

Instantly share code, notes, and snippets.

@ppartarr
Created September 7, 2018 09:23
Show Gist options
  • Save ppartarr/7896ff757d0dff6bfda6dc430b4033e6 to your computer and use it in GitHub Desktop.
Save ppartarr/7896ff757d0dff6bfda6dc430b4033e6 to your computer and use it in GitHub Desktop.
White space title page with image background
// HTML
/*<div id="parent">
<div id="photo"></div>
<h1 id="title">anything</h1>
</div>*/
// CSS
#parent {
height: 95vh;
margin: 0;
padding: 0;
}
#photo {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
height: 105vh;
width: auto;
z-index: -1;
transform: translateX(-50%) translateY(-51%);
background-size: cover;
background-color: white;
transition: 1s opacity;
background-image: url("../img/sea.jpg");
}
#title {
heigth: 95vh;
margin: 0;
font-align: center;
font-size: 30em;
font-weigth: 900;
line-height:0.9em;
letter-spacing: -0.1em;
isolation: isolate;
mix-blend-mode: darken;
background: black;
color: white;
}
@ppartarr
Copy link
Author

ppartarr commented Sep 7, 2018

Demo

title

Background image

sea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment