Skip to content

Instantly share code, notes, and snippets.

@sergio9508
Created January 10, 2020 03:40
Show Gist options
  • Save sergio9508/94c812f8dc9428fce285395f2d9a08c0 to your computer and use it in GitHub Desktop.
Save sergio9508/94c812f8dc9428fce285395f2d9a08c0 to your computer and use it in GitHub Desktop.
.overlay {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.7);
transition: opacity 500ms;
visibility: hidden;
opacity: 0;
}
.overlay:target {
visibility: visible;
opacity: 1;
z-index: 99;
}
#popupBody {
width: 50%;
padding: 1%;
border-radius: 15px;
position: relative;
transition: all 5s ease-in-out;
z-index: 0;
margin: 2% auto;
}
.popupContent{
display: flex;
justify-content: center;
align-items: center;
}
iframe{
border-color: black;
}
#cerrar {
position: absolute;
top: 20px;
left: 10px;
transition: all 200ms;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: white;
}
.imagen{
max-width: 100%;
}
.container{
max-width: 1100px;
display: block;
margin: auto;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./style.css">
<title>Document</title>
</head>
<body>
<div class="container">
<a href="#popup"><img class="imagen" src="./ciencia-del-universo-1530540262286.jpg" alt="" srcset=""></a>
<p class="video-description">hello</p>
<div id="popup" class="overlay">
<div id="popupBody">
<h2>Terms and conditions</h2>
<a id="cerrar" href="#">&times;</a>
<div class="popupContent">
<iframe class="video"
src="https://www.youtube.com/embed/_SKbW8gnLFM" width="640" height="480">
</div>
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment