Hallo zusammen,
seit mehreren Stunden bzw. Tagen versuche ich ein kleines animierte Hover Element mit einer Verlinkung in CSS/HTML zu programieren.
Die Animation konnte ich mit ´hover´Funktion zusammen mit ´before´ und ´after´ Psydoelementen herstellen.
Die Verlinkung schaffe ich irgendwie nicht
Der Text springt immer weg, oder das hover funktioniert dann nicht mehr.
Vielleicht könnt Ihr helfen...
Ich habe eine kleine Bildbeschreibung eingefügt.
Viele Grüße
Marty
<!-- DOCTYPE html -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>12eckenform</title>
<style>
/*12eckenform*/
a.eckenform {
height: 180px;
width: 180px;
background: rgb(9,36,160);
display: block;
color:#FFF;
position: relative;
float:left;
margin:40px 90px;
-moz-border-radius: 30px;
border-radius: 30px;
-webkit-box-shadow: 1px 0px 8px rgba(0,0,0,1.7);
-moz-box-shadow: 1px 0px 8px rgba(0,0,0,1.7);
box-shadow: 1px 0px 8px rgba(0,0,0,1.7);
}
a.eckenform:before {
z-index:-1;
height: 100%; /* 180px ursprünglich */
width: 100%; /* 180px ursprünglich */
background: rgb(187,187,187);
content:"";
position: absolute;
/* Rotate */
-moz-transform: rotate(30deg);
-webkit-transform: rotate(30deg);
-ms-transform: rotate(30deg);
-o-transform: rotate(30deg);
transform: rotate(30deg);
-moz-border-radius: 30px;
border-radius: 30px;
-webkit-box-shadow: 1px 0px 1px rgba(0,0,0,.9);
-moz-box-shadow: 1px 0px 1px rgba(0,0,0,.9);
box-shadow: 1px 0px 1px rgba(0,0,0,.9);
-moz-transform: transition: .01s;
-webkit-transform: transition: .01s;
-ms-transform: transition: .01s;
-o-transform: transition: .01s;
}
a.eckenform:after {
z-index:-1;
height: 100%; /* 180px ursprünglich */
width: 100%; /* 180px ursprünglich */
background: rgb(179,186,215);
content:"";
position: absolute;
/* Rotate */
-moz-transform: rotate(-30deg);
-webkit-transform: rotate(-30deg);
-ms-transform: rotate(-30deg);
-o-transform: rotate(-30deg);
transform: rotate(-30deg);
-moz-border-radius: 30px;
border-radius: 30px;
-webkit-box-shadow: 1px 0px 5px rgba(0,0,0,.8);
-moz-box-shadow: 1px 0px 5px rgba(0,0,0,.8);
box-shadow: 1px 0px 5px rgba(0,0,0,.8);
-moz-transform: transition: .01s;
-webkit-transform: transition: .01s;
-ms-transform: transition: .01s;
-o-transform: transition: .01s;
text-align:center;
align-items: center;
justify-content: center;
}
a.eckenform:hover {
cursor: pointer;
background: rgb(179,186,215);
color: #0924a0;
}
a.eckenform:hover:before {
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
cursor: pointer;
color: #0924a0;
/* display: none; */
}
a.eckenform:hover:after {
-moz-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
cursor: pointer;
content: attr(data-title);
z-index:1;
margin-left: auto;
margin-right: auto;
/*padding: 0; */
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5em;
color: #0924a0; /* h2 */
/* margin-top: 1em; */
text-align:center;
font-weight: bold;
}
/*Character Styles - Titles*/
.eckenform h3 {
position: absolute;
left:1px;
right:0px;
text-align:center;
/* color:#FFF; */
/* font-size:20px; */
display:inline-block;
font-weight: normal
}
.eckenform h3{
font-family: 'Berkshire Swash', serif;
margin:15px auto; /* Text hoch runter einstellen */
text-shadow: 0px 0px 3px rgba(0,0,0,0.6);
}
.badges-container {
margin-left: auto;
margin-right: auto;
/*padding: 0; */
display: flex;
align-items: center;
justify-content: center;
}
.fett {
font-weight: bold;
}
</style>
</head>
<body>
<div class="badges-container">
<div class="row">
<a href="https://www.google.de" class="eckenform" data-title="Mich kontaktieren"></a>
<h3 class="vorher">Hallo, <span class="fett">die Preise </span>sind<br>hier.<br><br>
Interessiert?<br>
<span class="fett">Bitte hier klicken!</span></h3>
</div>
</body>
</html>