Skip to content

Instantly share code, notes, and snippets.

@alexsoin
Created December 12, 2017 07:32
Show Gist options
  • Save alexsoin/68fe241c30c65024e08282ca058b844b to your computer and use it in GitHub Desktop.
Save alexsoin/68fe241c30c65024e08282ca058b844b to your computer and use it in GitHub Desktop.
Добавление затемнения на background
.bg {
background-image: url('img/img.jpg');
background-repeat: no-repeat;
background-position: top center;
background-size: cover;
height: 100vh;
width: 100%;
position: relative;
-webkit-transition: all 0.4s;
-moz-transition: all 0.4s;
transition: all 0.4s;
}
.bg:before {
content: "";
position:absolute;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment