I'm in the process of playing with css a bit. Unfortunately, it doesn't look quite the way I'd like it to yet. The speech bubble should be smaller and directly above them. The other reason is the rotation when the mouse pointer goes over the speech bubble the complete speech bubble should rotate. Unfortunately, when you rotate it, everything else looks like a speech bubble....
How do I make the bubble smaller and put it over them and how do I make the rotation look better.
HTML
#import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');
body {
padding: 50px;
font-family: 'Montserrat', sans-serif;
}
.spinner-text {
color: #fff;
}
.spinning {
color: #fff;
}
.spinning:hover {
width: 100px;
height: 100px;
color: #fff;
background-color: #5869FF;
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
/* transform: rotate(3deg); */
/* transform: rotate(0.3rad);/ */
/* transform: rotate(3grad); */
/* transform: rotate(.03turn); */
}
#keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
.bubble {
position: relative;
font-family: sans-serif;
font-size: 18px;
line-height: 24px;
width: 300px;
color: #fff;
background: #5869FF;
border-radius: 40px;
padding: 24px;
text-align: center;
color: #000;
}
.bubble-bottom-left:before {
content: "";
width: 0px;
height: 0px;
position: absolute;
border-left: 24px solid #5869FF;
border-right: 12px solid transparent;
border-top: 12px solid #5869FF;
border-bottom: 20px solid transparent;
left: 32px;
bottom: -24px;
}
.blue {
color: #5869FF;
}
.black {
color: #3B3B3B;
}
.text {
text-align: center;
display: flex;
margin-top: 35px;
}
<div>
<div class="spinning">
<div class="bubble bubble-bottom-left" contenteditable>
<div class="spinner-text">
:)
</div>
</div>
</div>
<div class="text">
<div class="blue">this</div>
<div class="black">is</div>
<div class="blue">name</div>
</div>
</div>
What I have
What I want
Try this, Instead of animation on .spinning div and animation on .spinner-text only
#import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');
body {
padding: 50px;
font-family: 'Montserrat', sans-serif;
}
.spinner-text {
color: #fff;
}
.spinning {
margin-left: 30px;
}
.spinning:hover .bubble .spinner-text {
background-color: #5869FF;
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
/* transform: rotate(3deg); */
/* transform: rotate(0.3rad);/ */
/* transform: rotate(3grad); */
/* transform: rotate(.03turn); */
}
#keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
.bubble {
position: relative;
font-family: sans-serif;
font-size: 30px;
line-height: 28px;
width: 52px;
height: 52px;
color: #fff;
padding: 0;
text-align: center;
color: #000;
}
.bubble-bottom-left:before {
content: "";
width: 0px;
height: 0px;
position: absolute;
border-left: 14px solid #5869FF;
border-right: 12px solid transparent;
border-top: 12px solid #5869FF;
border-bottom: 20px solid transparent;
left: 15px;
bottom: -20px;
}
.bubble .spinner-text {
background: #5869FF;
border-radius: 40px;
padding: 12px;
border-radius: 40px;
}
.blue {
color: #5869FF;
}
.black {
color: #3B3B3B;
}
.text {
text-align: center;
display: flex;
margin-top: 20px;
font-weight: bold;
font-size: 20px;
}
<div>
<div class="spinning">
<div class="bubble bubble-bottom-left" contenteditable>
<div class="spinner-text">
:)
</div>
</div>
</div>
<div class="text">
<div class="blue">this</div>
<div class="black">is</div>
<div class="blue">name</div>
</div>
</div>
Here you have the solution which is coresponding with the screenshot of your requirements. I have modified Minals code to get a faster solution because he did really good job with fixing the rotate issue.
#import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');
body {
padding: 50px;
font-family: 'Montserrat', sans-serif;
}
.spinner-text {
color: #fff;
font-size:20px;
font-weight:700;
width:40px;
}
.spinning {
margin-left: 115px;
}
.spinning:hover .bubble .spinner-text {
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
.bubble .spinner-text {
background: transparent!important;
border-radius: 40px;
padding: 10px;
border-radius: 40px;
position:absolute;
left:-10px;
bottom:2px;
}
#keyframes spin {
from {
transform:rotate(0deg);
}
to {
transform:rotate(360deg);
}
}
.bubble {
position: relative;
font-family: sans-serif;
font-size: 18px;
line-height: 24px;
width: 0px;
height:0px;
background: #5869FF;
border-radius: 40px;
padding: 21px;
text-align: center;
color: #000;
top:14px;
}
.bubble-bottom-left:before {
content: "";
width: 10px;
height: 15px;
position: absolute;
background-color: #5869ff;
left: 5px;
bottom: -8px;
border-radius: 0px 0px 100px 0px;
transform: translate(0, -5px);
}
.blue {
color: #5869FF;
font-size:25px;
font-weight:600;
}
.black {
color: #3B3B3B;
font-size:25px;
font-weight:600;
}
.text {
text-align: center;
display: flex;
margin-top: 20px;
font-weight: bold;
font-size: 20px;
}
<div>
<div class="spinning">
<div class="bubble bubble-bottom-left" contenteditable>
<div class="spinner-text">
:)
</div>
</div>
</div>
<div class="text">
<div class="blue">this</div>
<div class="black">is</div>
<div class="blue">name</div>
</div>
</div>
You need to set a transform origin by transform-origin: 0% 0% to rotate element in center or what point you want to transform.
See JSFiddle Sample
body {
padding: 50px;
font-family: "Montserrat", sans-serif;
}
.spinner-text {
color: #fff;
}
.spinning {
color: #fff;
position: absolute;
bottom: 28px;
left: 80px;
width: 40px;
height: 40px;
}
.spinning:hover {
cursor: default;
color: #fff;
animation-name: spin;
animation-duration: 5000ms;
animation-iteration-count: infinite;
animation-timing-function: linear;
transform-origin: 50% 50%;
}
#keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
#speechBubble {
display: block;
position: relative;
}
.bubble {
position: absolute;
font-family: sans-serif;
font-size: 18px;
line-height: 20px;
width: 20px;
height: 20px;
color: #fff;
background: #5869ff;
border-radius: 50%;
padding: 10px;
text-align: center;
}
.bubble-bottom-left:before {
content: "";
width: 6px;
height: 18px;
position: absolute;
background-color: #5869ff;
transform: rotate(35deg);
left: 15px;
bottom: -8px;
border-radius: 0px 0px 40px 0px;
}
.blue {
color: #5869ff;
}
.black {
color: #3b3b3b;
}
.text {
text-align: center;
display: flex;
margin-top: 35px;
font-weight: 600;
font-size: 20px;
}
/* EOS */
<div id="speechBubble">
<div class="spinning">
<div class="bubble bubble-bottom-left" contenteditable>
<div class="spinner-text">
:)
</div>
</div>
</div>
<div class="text">
<div class="blue">this</div>
<div class="black">is</div>
<div class="blue">name</div>
</div>
</div>
Related
I have removed irrelevant stuff to keep the question short, I had an issue with the same code earlier, I asked few more questions after it was resolved but did not hear back, that's why make a new post.
maintext class is not responding to any CSS styling e.g. border, background or other cosmetic properties, but has a major effect on the enclosing elements when commented out or deleted. Even an empty CSS declaration keeps the contents together when maintext class is deleted/commented out h1 spreads out and the effects go wild.
I want to position the maintext class including content elements to the right middle of the landing page. I can position button element and h1 items separately using with maintext class, using left and top properties, but I want the maintext block to position as a single unit.
#import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght#700&family=Reggae+One&display=swap');
html {
margin: 0;
padding: 0;
background-image: url(main.jpg);
width: 100%;
height: 100%;
background-size: cover;
z-index: 100;
position: relative;
}
html::before {
content: "";
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: white;
opacity: .3;
z-index: -10;
}
.menu {
display: inline-block;
margin-left: 52%;
/* border: 2px solid red; */
}
.menu ul {
right: 10px;
top: 10px;
list-style-type: none;
text-align: center;
border-radius: 10px;
background-color: transparent;
display: flex;
justify-content: center;
width: 600px;
padding: 0 10px;
height: 50px;
background-image: url(main.jpg);
background-size: cover;
background-position-x: -650px;
background-repeat: no-repeat;
background-color: tranparent .6;
}
.menu ul a {
text-decoration: none;
color: inherit;
transition-duration: 2s;
box-sizing: border-box;
}
.menu ul li {
border-collapse: collapse;
font-size: 18px;
font-family: 'Reggae One', cursive;
color: black;
box-sizing: border-box;
text-align: center;
margin-top: auto;
margin-bottom: auto;
margin-right: 40px;
display: inline-block;
/* padding: 7px 15px; */
border-radius: 7px;
transition-duration: 1s;
transition-timing-function: ease;
position: static;
font-weight: bolder;
background: transparent;
/* border: 1px solid red; */
text-decoration: underline;
}
.menu ul li:hover {
color: red;
/* box-shadow: 1px 1px 200px 200px rgba(92,137,204,.3); */
box-shadow: 1px 1px 200px 200px rgba(0, 0, 0, .3);
border: 1px solid black;
/* border: 1px solid rgba(0,0,0,.3); */
background: transparent;
}
/* /* .am
{
position:absolute;
}
ul.am{
position: absolute;
/* border: 2px solid red; */
/* list-style-type:none;
list-style-position: inside;
text-decoration: none;
display:none;
*/
*/
/* }
ul.am li{
display:block;
text-align: left;
margin-left:-40px;
padding:5px 0;
}
.menu ul li:hover ul.am{
display:block;
} */
*/
/*Main text on the main page*/
.maintext {
padding: 0;
margin: 0;
width: 100px;
height: 100px;
border: 2px solid red;
}
.maintext h1 {
z-index: 23;
color: transparent;
display: inline-block;
position: relative;
left: 900px;
top: 200px;
font-family: 'Reggae One', cursive;
border: 2px solid red;
margin-top: -10px;
animation: show .5s ease forwards;
animation-delay: 1s;
}
.maintext h1 span {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 0;
background-color: rgba(0, 0, 0, .2);
animation: overlay 1s ease forwards;
animation-delay: .5s;
}
h1:nth-of-type(1) {
animation-delay: 1s;
}
h1:nth-of-type(2) {
animation-delay: 2s;
}
h1:nth-of-type(3) {
animation-delay: 3s;
}
h1:nth-of-type(1) span {
animation-delay: .5s;
}
h1:nth-of-type(2) span {
animation-delay: 1.5s;
}
h1:nth-of-type(3) span {
animation-delay: 2.5s;
}
.maintext .butt {
z-index: 45;
position: relative;
left: 900px;
top: 200px;
width: 250px;
height: 50px;
padding: 5px 30px;
border-radius: 8px;
background-color: transparent;
font-size: 25px;
font-weight: bolder;
font-family: 'Reggae One', cursive;
letter-spacing: 4px;
transition-duration: 2s;
transition-timing-function: ease;
color: black;
border: 2px solid black;
}
.maintext .butt:hover {
color: white;
box-shadow: 1px 1px 200px 200px rgba(92, 137, 204, .3);
background: transparent;
}
.maintext .align h1 {
display: flex;
justify-content: center;
align-items: center;
}
#keyframes overlay {
50% {
width: 100%;
left: 0;
}
100% {
left: 100%;
width: 0;
}
}
#keyframes show {
100% {
color: rgb(0, 0, 0, .8);
}
}
<section class="hero">
<div class="menu">
<ul>
<li>About Me</li>
<li>Work Experience</li>
<li>Hobbies</li>
<li>Gallery</samp>
</li>
</ul>
</div>
<div class="maintext">
<h1 class="align">Hello, <span></span></h1><br>
<h1 class="align">My Name is <span></span></h1><br>
<h1 class="align">Abc Xyz <span></span></h1><br>
<!-- <button class="butt align">Portfolio</button> -->
</div>
<div style="clear: both"></div>
</section>
I'm trying to add and modify some animated CSS that I found to a 'subscription form' that I originally created. The problem is that the animation I found does not fit within the confines of my form (i.e., it's too big). I've tried to change the font size of the animation, but that seems to make things worse. I'm not even certain that my html is 100% correct. At best, I am a beginner. You'll find my code below:
<!DOCTYPE html>
<html>
<head>
<style>
/*Original CSS for animated text I found*/
#import url('https://fonts.googleapis.com/css2?family=Poppins:wght#200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
background: #343F4F;
}
.wrapper{
display: flex;
}
.wrapper .static-txt{
color: #000;
font-size: 60px;
font-weight: 400;
}
.wrapper .dynamic-txts{
margin-left: 15px;
height: 90px;
line-height: 90px;
overflow: hidden;
}
.dynamic-txts li{
list-style: none;
color: #FC6D6D;
font-size: 60px;
font-weight: 500;
position: relative;
top: 0;
animation: slide 12s steps(4) infinite;
}
#keyframes slide {
100%{
top: -360px;
}
}
.dynamic-txts li span{
position: relative;
margin: 5px 0;
line-height: 90px;
}
.dynamic-txts li span::after{
content: "";
position: absolute;
left: 0;
height: 100%;
width: 100%;
background: #343F4F;
border-left: 2px solid #FC6D6D;
animation: typing 3s steps(10) infinite;
}
#keyframes typing {
40%, 60%{
left: calc(100% + 30px);
}
100%{
left: 0;
}
}
/*Original CSS for my form*/
form {
border: 5px solid #000;
padding: 3px;
text-align: center;
border-left-width: 10px;
border-right-width: 10px;
width: 500px;
background-color: #efefef;
height: 200px;
}
input[type=submit] {
display: inline;
padding: 10px 30px;
font-weight: 300;
border-radius: 200px;
transition: background-color 0.2s, border 0.2s, color 0.2s;
font-size: 15px;
}
input[type=submit] {
background-color: #ff0000;
color: #fff;
border: 1px solid #000;
font-weight: bold;
}
input[type=submit]:hover,
input[type=submit]:active {
background-color: #ff5e5e;
}
.directions {
font-weight: bold;
}
input[type=text] {
width: 200px;
}
</style>
</head>
<body>
<form action="https://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" `onsubmit="window.open('https://feedburner.google.com/fb/a/mailverify?uri=blogspot/BKkas', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">`
<div class="wrapper">
<div class="static-txt">Subscribe</div>
<ul class="dynamic-txts">
<li><span>Enter Your Email</span></li>
<li><span>To get the most recent news</span></li>
<li><span>delivered right to your inbox.</span></li>
<li><span>SIGN-UP NOW!</span></li>
</ul>
</div>
<p><input type="text" name="email"/></p><br/>
<input type="hidden" value="blogspot/BKkas" name="uri"/>
<input type="hidden" name="loc" value="en_US"/>
<input type="submit" value="Subscribe" />
</form>
</body>
</html>
Here is the text fit into the box.
<!DOCTYPE html>
<html>
<head>
<style>
/*Original CSS for animated text I found*/
#import url('https://fonts.googleapis.com/css2?family=Poppins:wght#200;300;400;500;600;700&display=swap');
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
display: flex;
align-items: center;
justify-content: center;
min-height: 80vh;
background: #343F4F;
}
.wrapper{
display: flex;
}
.wrapper .static-txt{
color: #000;
font-size: 20px;
margin-left:40px;
line-height: 90px;
font-weight: 400;
}
.wrapper .dynamic-txts{
margin-left: 15px;
height: 90px;
line-height: 90px;
overflow: hidden;
}
.dynamic-txts li{
list-style: none;
color: #FC6D6D;
font-size: 20px;
font-weight: 500;
position: relative;
top: 0;
animation: slide 12s steps(4) infinite;
}
#keyframes slide {
100%{
top: -360px;
}
}
.dynamic-txts li span{
position: relative;
margin: 5px 0;
line-height: 90px;
}
.dynamic-txts li span::after{
content: "";
position: absolute;
left: 0;
top: 0px;
height: 100%;
width: 100%;
background: #343F4F;
border-left: 2px solid #FC6D6D;
animation: typing 3s steps(10) infinite;
}
#keyframes typing {
40%, 60%{
left: calc(100% + 30px);
}
100%{
left: 0;
}
}
/*Original CSS for my form*/
form {
border: 5px solid #000;
padding: 3px;
text-align: center;
border-left-width: 10px;
border-right-width: 10px;
width: 500px;
background-color: #efefef;
height: 200px;
}
input[type=submit] {
display: inline;
padding: 10px 30px;
font-weight: 300;
border-radius: 200px;
transition: background-color 0.2s, border 0.2s, color 0.2s;
font-size: 15px;
}
input[type=submit] {
background-color: #ff0000;
color: #fff;
border: 1px solid #000;
font-weight: bold;
}
input[type=submit]:hover,
input[type=submit]:active {
background-color: #ff5e5e;
}
.directions {
font-weight: bold;
}
input[type=text] {
width: 200px;
}
</style>
</head>
<body>
<form action="https://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" `onsubmit="window.open('https://feedburner.google.com/fb/a/mailverify?uri=blogspot/BKkas', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true">
<div class="wrapper">
<div class="static-txt">Subscribe</div>
<ul class="dynamic-txts">
<li><span>Enter Your Email</span></li>
<li><span>To get the most recent news</span></li>
<li><span>delivered right to your inbox.</span></li>
<li><span>SIGN-UP NOW!</span></li>
</ul>
</div>
<p><input type="text" name="email"/></p><br/>
<input type="hidden" value="blogspot/BKkas" name="uri"/>
<input type="hidden" name="loc" value="en_US"/>
<input type="submit" value="Subscribe" />
</form>
</body>
</html>
I used to do my best to solve the problem, however, it doesn't work. As you can see, if you run the code the animation is not inline or they are not in proper position, what I want to - the animation should be in between or centered in the Let's Make and Awesome elements. Looking forward and answer and if you mind can you please explain to make so that i will understand it fully. Thank You so much
.circle {
position: relative;
border-radius: 50%;
width: 30rem;
height: 30rem;
background-color: #6CA9A5;
margin: 5rem auto;
}
.hello, .hello2 {
position: relative;
text-transform: uppercase;
font-family: "Montserrat", sans-serif;
font-weight: 900;
letter-spacing: .2rem;
font-size: 1.5rem;
color: #fff;
text-align: center;
padding: 70px 0 2px 0;
/* z-index: 1; */
}
.hello2 {
position:absolute;
top: 58px; /* changeable */
left:50%;
transform:translateX(-50%);
}
.hello span:hover {
color: #f4511e;
transition: .59s;
}
.circle a {
position: absolute;
top:60%; /* changeable */
left:50%;
transform:translateX(-50%);
font-size: 15px;
text-decoration: none;
background: #fff;
padding: 15px 35px;
border-radius: 35px;
text-transform: uppercase;
}
/* .more a {
height: 150px;
width: 500px;
background-color: #fff;
} */
#container {
color:#999;
text-transform: uppercase;
font-family: "Montserrat", sans-serif;
font-size: 1.5rem;
font-weight: bold;
padding-top: 200px;
position: relative;
width:100%;
bottom: 45%;
display:block;
text-align: center;
}
#flip {
height: 80px;
overflow:hidden;
}
#flip > div > div {
border-radius: 30px;
color:#fff;
padding:4px 15px 4px 15px;
height:30px;
margin-bottom: 62px;
display:inline-block;
}
#flip > div > .ever {
/* height: 59px; */
}
#flip div:first-child {
animation: show 5s linear infinite;
}
#flip div div {
background:#42c58a;
}
#flip div:first-child div {
background:#4ec7f3;
}
#flip div:last-child div {
background:#DC143C;
}
#keyframes show {
0% {margin-top:-270px;}
5% {margin-top:-180px;}
33% {margin-top:-180px;}
38% {margin-top:-90px;}
66% {margin-top:-90px;}
71% {margin-top:0px;}
99.99% {margin-top:0px;}
100% {margin-top:-270px;}
}
<div class="content">
<h1 class="possible">Everything is Possible</h1>
<div class="circle">
<p class="hello">Let's Make </p>
<div id="container">
<div id="flip">
<div><div>wOrK</div></div>
<div><div>lifeStyle</div></div>
<div><div class="ever">Everything</div></div>
</div>
</div>
<p class="hello2">Awesome</p>
Read More
</div>
</div>
Hi so Im trying to get a circle to flip when I hover over it. As of now, the circle flips and changes color, but once the animation finishes the text on the reverse side of the circle disappears.
.header{
perspective: 700px;
}
body, html {
background: url(bg.jpg);
background-size: 110px 69px;
font-family: 'Playfair Display', serif;
}
body{
/*background-color: #ccf2ff;*/
background-color: #99ebff;
}
#-webkit-keyframes magnify {
from {background-color: #00e699; }
to {background-color: #00cc99;}
}
.header h1:hover{
/*background-color: #00cc99;
-webkit-animation-name: magnify; /* Chrome, Safari, Opera */
/* -webkit-animation-duration: 0.5s; /* Chrome, Safari, Opera */
/*animation-name: magnify;
animation-duration: 0.5s;
-webkit-animation-fill-mode: forwards;*/
}
.name{
font-size: 16px
}
#-webkit-keyframes magnifytext {
from {font-size: 16px; }
to {font-size: 18px;}
}
.name:hover{
-webkit-animation-name: magnifytext; /* Chrome, Safari, Opera */
-webkit-animation-duration: 0.1s; /* Chrome, Safari, Opera */
animation-name: magnifytext;
animation-duration: 0.1s;
-webkit-animation-fill-mode: forwards;
}
body p {
font-style: italic;
font-size: 16px;
}
.card{
border-radius: 100%;
background-color: #00e699;
box-shadow: 0 2px 5px rgba(0,0,0,0.25);
height: 200px;
width: 200px;
margin: 60px auto 0;
text-align: center;
z-index: 0;
transition: all 0.6s ease;
transform-style: preserve-3d;
}
.front, .back{
backface-visibility:hidden;
}
.back{
position: relative;
top: -191px;
margin: 60px auto 0;
transform: rotateY(180deg);
}
.header h1 {
}
.card:hover {
background-color:#cc00cc;
transform: rotateY(180deg);
}
.header h1 span {
color:#fff;
display: block;
font-size: 30px;
padding: 65px 0 0 0;
}
.header h1 span+span {
color:#000;
display: block;
font-size: 28px;
padding: 0;
}
.main .container {
background:#fff;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
margin: -70px auto 80px;
padding: 80px;
z-index: 0;
}
h1 {
color: #444;
font-family: 'Oswald', sans-serif;
font-size: 16px;
margin: 20px 0 0 0;
text-align: center;
text-transform: uppercase;
}
h2 {
border-bottom: 1px solid #444;
color: #000;
font-family: 'Oswald', sans-serif;
margin: 20px 0 10px;
padding: 0 0 10px 0;
text-transform: uppercase;
}
h3 {
color: #00cc99;
font-family: 'Oswald', sans-serif;
margin: 10px 0 5px;
text-transform: uppercase;
}
.price p {
font-family: 'Oswald', sans-serif;
font-size: 20px;
font-style: normal;
margin: 26px 0 5px;
text-align: right;
}
<div class="header" ><!-- cardcontainer-->
<div class="card">
<div class="front">
<h1><span >Appointment Reminders</span></h1>
</div>
<div class="back">
<h1> <span style="position: relative; top: 10px;">Add patient<span></h1>
</div>
</div>
</div>
Thanks!
the problem is that you transform the "back"-div and on hover you try to transform the whole card, which transforms the front and the "back" divs once again. I hope this can help you:
<div class="header">
<div class = "card">
<div class = "front">
<h1><span >Appointment</span></h1>
</div>
<div class = "back">
<h1><span>Add patient</span></h1>
</div>
</div>
</div>
and the css:
.header{
perspective: 700px;
}
body{
background-color: #99ebff;
}
.card {
border-radius: 200px;
box-shadow: 0 2px 5px rgba(0,0,0,0.25);
height: 200px;
width: 200px;
margin: 60px auto 0;
text-align: center;
transition: all 0.6s ease;
transform-style: preserve-3d;
}
.front, .back{
position: absolute;
height: 100%;
width: 100%;
border-radius: 100%;
backface-visibility:hidden;
}
.front {
background-color: red;
}
.back{
background: green;
transform: rotateY(-180deg);
}
.card:hover {
transform: rotateY(180deg);
}
.header h1 span {
color:#fff;
display: block;
font-size: 16px;
padding: 65px 0 0 0;
}
CSS:
#content-items .thumb-artist img {
width: 220px;
position: relative;
z-index: 10;
height: 147px;
}
#filter-artist {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
padding: 25px 0 25px 10px;
position: relative;
font-weight: bold;
color: #666666;
text-transform: uppercase;
float: left;
width: 100%;
line-height: 1.4em;
}
#filter-artist #s {
border: 0;
font-size: 10px;
color: #666666;
background: transparent;
text-transform: uppercase;
font-family: Arial, Helvetica, sans-serif;
padding: 1px 0px;
width: 80%;
}
#content-items {
width: 960px;
margin: 0 auto;
color: #fff;
}
#filter-artist span {
float: left;
}
#filter-artist a {
color: #666666;
padding: 0 8px;
float: left;
}
.active-filter {
color: #fff!important;
}
#filter-artist #submit {
background-image: url(img/icons.png);
background-position: -84px 0px;
background-color: transparent;
border: 0;
height: 14px;
line-height: 0;
padding: 0;
width: 14px;
float:right;
}
#filter-artist > p {display:none;}
#filter-artist form {
float: left;
border-bottom: 1px solid #666666;
}
#filter-artist #submit:hover {
background-image: url(img/icons.png);
background-position: -84px -14px;
}
#content-items .artist {
width: 25%;
float: left;
padding: 0 1% 40px 1%;
line-height: 1em;
height: 270px;
height: 190px!important;
}
#content-items .thumb-artist {
position: relative;
}
.thumb-artist img:hover .social-content {
opacity:1;
}
#content-items .artist h3 {
font-size: 18px;
margin: 10px 0;
line-height: 1em;
color: #fff;
font-family: "futura-pt",sans-serif;
}
}
element.style {
display: none;
}
#load-items .social-content {
position: absolute;
top: 80%;
left: 0%;
z-index: 15;
width: 100%;
text-align: center;
opacity:0;
-webkit-transition: all 0.5s ease-in;
-moz-transition: all 0.5s ease-in;
-o-transition: all 0.5s ease-in;
transition: all 0.5s ease-out;
}
.social {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
line-height: 1em;
display: inline-block;
font-size: 10px;
font-family: Arial, Helvetica, sans-serif;
color: #fff;
line-height: 11px;
margin-right: 4px;
}
.facebook {
position:relative;
background-image: url(img/icons.png);
background-position: -3px -1px;
width: 20px;
height: 20px;
padding: 5px;
z-index:15;
float:left;
}
.web {
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
float:left;
}
.sat-color {
background-color: #ff0033;
padding: 5px;
}
.social-content a:hover {
color: #ff3333;
}
.twitter {
position:relative;
background-image: url(img/icons.png);
background-position: -45px -1px;
width: 20px;
height: 20px;
padding: 5px;
float:left;
}
#load-items .social-content:hover {
position: absolute;
top: 80%;
left: 0%;
z-index: 15;
width: 100%;
text-align: center;
opacity:1;
}
.sat-color:hover {
background-color: #ff3333;
color: #fff !important;
}
HTML:
<article id="content-items">
<div id="filter-artist">
<span>FILTER:</span>
ALLNEWESTALPHABETICAL</div>
<div id="load-items">
<div class="artist">
<div class="thumb-artist">
<img width="300" height="138" src="http://downunderlabelgroup.com/wp-content/uploads/2013/03/k_oconnor_lge-300x138.jpg" class="attachment-medium wp-post-image" alt="Kim O'Connor">
<span class="social-content">
OFFICIAL SITE
</span>
</div>
<h3 class="name-artist">Troye Sivan</h3>
</div></div></article>
At the moment the hover effect is only applied when the mouse is hovered onto the social content. I would like to apply it to the whole picture.
So if anyone hovers onto the image the social content is displayed.
Thanks alot.
There are 2 options, 1 make the hover on the div, 2 hover on the img
1st option (recommended):
#content-items .thumb-artist:hover .social-content {
opacity: 1;
}
2nd option (use + next selector):
#content-items .thumb-artist .wp-post-image:hover + .social-content {
opacity: 1;
}
DEMO: http://jsfiddle.net/7w8spct6/
Maybe a CSS rule like this could work
img.attachement-medium:hover + .social-content {
position: absolute;
top: 80%;
left: 0%;
z-index: 15;
width: 100%;
text-align: center;
opacity:1;
}
But a better way would be to actually take the <img> and <span> elements you want and put them inside a new <div> and then have a rule for the contents of the <div>
<div class="wrapper">
<img width="300" height="138" src="http://downunderlabelgroup.com/wp-content/uploads/2013/03/k_oconnor_lge-300x138.jpg" class="content attachment-medium wp-post-image" alt="Kim O'Connor">
<span class="social-content content">
OFFICIAL SITE
</span>
</div>
.wrapper:hover .content {
/*styles*/ }