dimanche 2 juillet 2017

Trying to give a two different tints to background image using slanted divs

I am a new to learning HTML and CSS and I am trying to give a background image two tilted tint with slanted divs. I can't understand how to do it so that the slant is only in the middle and not on the edges of the image. Here's what I have tried so far.

.tinted-image {
  
  width: 100vw;
  height: 100vh;
  
  background: url(http://ift.tt/2shtr3K);
  background-size: cover;
  filter: grayscale(100%);
  display: flex;
  overflow: hidden;
}

#one{
  background: linear-gradient(rgba(0,0,0,0.85), rgba(0,0,0, 0.85));
  tranform-origin: bottom-left;
  transform: skewX(10deg);
/*   margin-left: 1em; */
}
#two{
  background: linear-gradient(rgba(255, 255, 255, .45), rgba(255, 255, 255, .45));
  transform: skewX(10deg);
}
#one, #two{
  height: 100vh;
  width: 50vw;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family:'Nova Mono', monospace;
  font-size: 5rem;
}

#one h1 {
  color: #eee;
  margin-left: auto;
  margin-right: 1rem;
}

#two h1 {
  color: #222;
  margin-right: auto;
  margin-left: 1rem;
}
 
<main class="tinted-image">
<link href="http://ift.tt/2qnBDxX" rel="stylesheet">
<div id = "one"><h1>WEB</h1></div>
<div id = "two"><h1>DEV</h1></div>
</main>



Aucun commentaire:

Enregistrer un commentaire