added lightbox for images

This commit is contained in:
root 2020-12-09 17:56:37 +01:00
parent f1cd624b5a
commit a013ca2b16
2 changed files with 48 additions and 2 deletions

View file

@ -251,6 +251,44 @@ img {
top: 0;
}
.lightbox {
/* Default to hidden */
display: none;
/* Overlay entire screen */
position: fixed;
z-index: 999;
top: 0;
left: 0;
right: 0;
bottom: 0;
/* A bit of padding around image */
padding: 1em;
/* Translucent background */
background: rgba(0, 0, 0, 0.8);
}
/* Unhide the lightbox when it's the target */
.lightbox:target {
display: block;
}
.lightbox span {
/* Full width and height */
display: block;
width: 100%;
height: 100%;
/* Size and position background image */
background-position: center;
background-repeat: no-repeat;
background-size: contain;
}
@media (min-width: 54em) {
.header li {
float: left;
@ -287,3 +325,4 @@ img {
width: 95%;
}
}

View file

@ -58,8 +58,15 @@
</div>
<div class="column right">
<h2>Michael und Sven</h2>
<img src="img/dinosven1.jpg" alt="">
<p>Die beiden Brauer von freibier.cc </p>
<a href="#img1">
<img src="img/dinosven1.jpg">
</a>
<!-- lightbox container hidden with CSS -->
<a href="#" class="lightbox" id="img1">
<span style="background-image: url('img/dinosven1.jpg')"></span>
</a>
<p>Die beiden Brauer von freibier.cc </p>
</div>
</div>