janosh
Neues Mitglied
guten abend. vielleicht kann mir jemand helfen. ich versuche mal, mein problem zu erläutern.
ich möchte, dass sich mein container mit der id "image_zoom" immer vertikal zentriert ausrichtet, egal, wie hoch das fenster ist. zudem möchte ich, dass sich das bild, welches in das img-tag geladen wird skaliert, sobald die höhe des fensters zu gering wird. vieleicht mag mir jemand dabei helfen.
ich möchte, dass sich mein container mit der id "image_zoom" immer vertikal zentriert ausrichtet, egal, wie hoch das fenster ist. zudem möchte ich, dass sich das bild, welches in das img-tag geladen wird skaliert, sobald die höhe des fensters zu gering wird. vieleicht mag mir jemand dabei helfen.
HTML:
<div id="lightbox">
<img class="close_window" src="img/x.png">
<div id="image_zoom">
<h4>Kategorie</h4>
<figure>
<img src="" alt="">
<figcaption>Bildunterschrift</figcaption>
<div class="pre"></div>
<div class="next"></div>
</figure>
</div>
</div>
CSS:
#lightbox {
height:100vh;
top:0;
width:100%;
background: #012733;
position: fixed;
z-index:1000;
display: none;
}
.close_window{
width: 23px;
height: 23px;
position: absolute;
right:26px;
top: 26px;
cursor: pointer;
}
#image_zoom {
margin: 0 auto;
width:calc(100% - 40px);
padding: 50px;
position: relative;
}
#image_zoom h4{
font-size:1.375rem;
color: coral;
border-bottom:1px solid coral;
margin-bottom: 20px;
padding-left: 0;
}
#image_zoom img{
width:100%;
}
#image_zoom figcaption{
text-transform: uppercase;
margin-top: 10px;
font-size:1.125rem;
font-family: 'AvenirLTStd-Book';
color: azure;
}
.pre{
position: absolute;
left:13px;
top:50%;
width: 17px;
height: 30px;
cursor: pointer;
padding:10px;
background-image:url(../img/pre.png);
background-repeat: no-repeat;
}
.next{
position: absolute;
right:9px;
top:50%;
width: 1px;
height: 30px;
cursor: pointer;
padding:10px;
background-image:url(../img/next.png);
background-repeat: no-repeat;
}
Zuletzt bearbeitet von einem Moderator: