In diesem Video zeige ich euch wie man mit #CSS ein Profilbild oder ein Bild mit einem coolen Hover Effekt versehen kann. Wenn also jemand darüber fährt sieht man den Name der Person. Perfekt für Business / Team Fotos
Video / Anleitung
HTML / CSS
Hier der HTML Teil
<div class="container">
<a href="#">
<span>Max Mustermann</span>
<img src="generated-photos-child.jpg">
</a>
</div>
Hier der CSS Teil
body {
background: #262626;
}
.container {
width: 600px;
margin: 5% auto;
}
.container a{
position: relative;
text-align: center;
width: 100%;
margin: 10px;
display: inline-block;
overflow: hidden;
}
.container a:before, .container a:after {
top: 0;
background: #b4151c;
content: '';
display: block;
height: 100%;
opacity: 0.5;
position: absolute;
width: 50%;
z-index: 3;
}
.container a:before {
left: 0;
}
.container a:after {
right: 0;
}
.container a img {
border: green 3px solid;
display: block;
z-index: 1;
}
.container a:before,
.container a:after,
.container a span {
transition: all 500ms ease;
}
.container a span {
color: #000;
background-color: rgba(255,255,255,0.8);
bottom: 15%;
display: block;
opacity: 0;
padding: 10px 25px;
position: absolute;
text-align: center;
text-transform: uppercase;
width: 70%;
z-index: 2;
left: 8%;
font-size: 25px;
transform: scale(0);
border-radius: 50px;
}
.container a:hover:before {
left: -50%;
}
.container a:hover:after {
right: -50%;
}
.container a:hover span {
opacity: 1;
transition: all 500ms ease;
transform: scale(1);
}
0 Kommentare