While doing transition - rotateY, words get reversed - html

I'm new to CSS3 and for the sake of learning it, I'm using CSS3d transform: rotateY property to rotate a button 180 with an ease transition. But due to 180 flip the words are shown in reversed. What can be done so that words in the button are shown in exactly the same manner before being rotate.
From what I've read so far is that I need to customize the back portion of the button but I don't know how to do that.
Here is my Codepen code: http://codepen.io/vikrantnegi007/pen/QbozLq
HTML:
<div class="container">
<div class="jumbotron">
<h1>Let's have fun!</h1>
<button id="btn1">btn1</button>
<button id="btn2">btn2</button>
<button id="btn3">btn3</button>
<button id="btn4">btn4</button>
</div><!-- /.jumbotron -->
</div>
CSS Code:
#import url(https://fonts.googleapis.com/css?family=Cinzel);
.container {
margin: 0 auto;
width: 500px;
background-color: rgba(35, 35, 35, 0.4);
text-align: center;
border-radius: 5px;
border: 2px solid #000;
}
.jumbotron {
font-family: "Cinzel";
padding-bottom: 20px;
}
h1 {
color: rgba(50, 50, 50);
}
button {
height: 50px;
width: 100px;
cursor: pointer;
text-transform: uppercase;
background-color: rgba(65, 69, 67, 0.5);
color: #fff;
border: 1.5px solid #fff;
border-radius: 5px 30px 5px 30px;
box-shadow: 0px 2px 5px rgba(110, 110, 110, 0.4);
margin-left: 5px;
-webkit-transition: all 1s ease;
transition: all 1s ease;
}
button:hover {
background-color: rgba(180, 180, 180, 0.4);
-webkit-transform: rotateY(180deg) scale(1.5);
transform: rotateY(180deg) scale(1.5);
}
button:active {
-webkit-transform: translate(1px, 1px) scale(0.9,0.9);
transform: translate(1px, 1px) scale(0.9, 0.9);
}

Generally when you rotate an element, the backside comes to the front and vice-versa. Since your background color is semi transparent, the reverse side is getting shown through.
One way to avoid the text being displayed in reverse is to put the text inside its own element (say a <span> tag) and then apply the reverse transform when the button is hovered on (like in the below snippet):
#import url(https://fonts.googleapis.com/css?family=Cinzel);
.container {
margin: 0 auto;
width: 500px;
background-color: rgba(35, 35, 35, 0.4);
text-align: center;
border-radius: 5px;
border: 2px solid #000;
}
.jumbotron {
font-family: "Cinzel";
padding-bottom: 20px;
}
h1 {
color: rgba(50, 50, 50);
}
button {
height: 50px;
width: 100px;
cursor: pointer;
text-transform: uppercase;
background-color: rgba(65, 69, 67, 0.5);
color: #fff;
border: 1.5px solid #fff;
border-radius: 5px 30px 5px 30px;
box-shadow: 0px 2px 5px rgba(110, 110, 110, 0.4);
margin-left: 5px;
-webkit-transition: all 1s ease;
transition: all 1s ease;
}
button:hover {
background-color: rgba(180, 180, 180, 0.4);
transform: rotateY(180deg) scale(1.5);
}
button:active {
transform: translate(1px, 1px);
transform: scale(0.9, 0.9);
}
button > span {
display: block;
transition: all 1s ease;
}
button:hover > span {
transform: rotateY(-180deg);
}
<div class="container">
<div class="jumbotron">
<h1>Let's have fun!</h1>
<button id="btn1"><span>btn1</span></button>
<button id="btn2"><span>btn1</span></button>
<button id="btn3"><span>btn1</span></button>
<button id="btn4"><span>btn1</span></button>
</div>
<!-- /.jumbotron -->
</div>
An alternate method would be to create a backside for the element and then make it get displayed when the button is being hovered on (like you had mentioned in question). You can find a sample for that in my answer here.

Related

How to make the button have a click effect when :active?

I made these buttons and I want to add an animation click effect to them such that, when the left button is clicked it goes down (slightly to the right) and comes back up.
And when the right button is clicked it goes down (slightly to the left) and comes back up.
And the background of the button should become dark red in the first few seconds and light up again.
The right button (NEXT >) works fine but the left one doesn't. Please tell me how to make the same animation on the left button (< PREVIOUS). Also suggest any changes if needed.
body {font-family: Verdana, sans-serif;}
i.fa {
font-size: 24px;
font-weight: bold;
}
a#previous, a#next {
text-decoration: none;
background-color: #f00;
color: white;
font-size: 1.3em;
padding: 12px 16px;
border-radius: 7px;
}
a#next {
float: right;
margin-top: -8.1px;
padding: 12.5px 16px;
box-shadow: -3px 3px rgb(190, 0, 0);
}
a#next:active {
animation: next_click .6s ease-in-out;
}
#keyframes next_click {
0% {background: rgb(225, 0, 0); box-shadow: -2px 2px rgb(180, 0, 0); transform: translate(-1px, 1px);}
100% {background: rgb(255, 0, 0); box-shadow: -3px 3px rgb(190, 0, 0); transform: translate(0, 0);}
}
a#previous {box-shadow: 3px 3px rgb(190, 0, 0);}
a#previous:active {
background: rgb(225, 0, 0);
box-shadow: 2px 4px rgb(180, 0, 0);
transform: translate(-1px, 1px);
}
a#previous:hover, a#next:hover {background: rgb(225,0,0);}
<!DOCTYPE html>
<html><head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<br><br>
<a id="previous" href="javascript:void(0);"><i class="fa fa-angle-left"></i> Previous</a>
<a id="next" href="javascript:void(0);">Next <i class="fa fa-angle-right"></i></a>
</body>
</html>
This is how I did it:
a#previous:active {
background: rgb(225, 0, 0);
box-shadow: 2px 4px rgb(180, 0, 0);
transform: translate(-1px, 1px);
/* add this animation*/
animation: previous_click 0.6s ease-in-out;
}
/*this is the keyframe for left button*/
#keyframes previous_click {
0% {
background: rgb(225, 0, 0);
box-shadow: 4px 4px rgb(180, 0, 0);
transform: translate(1px, -1px);
}
100% {
background: rgb(255, 20, 20);
box-shadow: 3px 3px rgb(190, 0, 0);
transform: translate(0, 0);
}
}

Creating ::after pseudo element causing problems with backface-visibility

I'm trying to create a flip card that has a shadow that fades in and out as it flips. I've read that the most efficient way (in terms of rendering) to animate a shadow is to create an ::after pseudo element with opacity of 0 and fade the shadow in. I'm attaching two snippets, one without the shadows that works fine, and the second that has the shadows and has a weird effect. Essentially, when the pseudo elements are there, the backface-visiblity property seems to glitch (or I'm missing something) but basically the back of the card shows immediately before it's even flipped over. I've slowed down the animation and added a red shadow to the back of the card so that it's easy to see what all is happening.
Thanks in advance.
.card {
perspective: 50rem;
background-color: #fff;
box-shadow: 5px 10px 10px rgba(51, 51, 51, 0.8);
width: 200px;
height: 300px;}
.card--flip {
background: none;
box-shadow: none; }
.card__side {
height: 400px;
width: 100%;
box-shadow: none;
background-color: #777;
transition: all 3s ease;
position: absolute;
top: 0;
left: 0;
backface-visibility: hidden; }
.card__side--front::after {
box-shadow: 5px 10px 10px rgba(51, 51, 51, 0.8);
opacity: 1;
transition: all 3s ease; }
.card__side--back {
transform: rotateY(-180deg); }
.card__side--back::after {
box-shadow: 5px 10px 10px rgba(255, 0, 0, 0.8);
opacity: 0;
transition: all 3s ease; }
.card:hover .card__side--front {
transform: rotateY(180deg); }
.card:hover .card__side--front::after {
opacity: 0; }
.card:hover .card__side--back {
transform: rotateY(0); }
.card:hover .card__side--back::after {
opacity: 1; }
.card__header {
padding: 2rem; }
.card__main {
padding: 2rem; }
WORKING
<div class="card card--flip">
<div class="card__side card__side--front">
<div class="card__header">
<h1>FRONT</h1>
</div>
<div class="card__main">front</div>
</div>
<div class="card__side card__side--back">
<div class="card__header">
<h1>BACK</h1>
</div>
<div class="card__main">back</div>
</div>
</div>
.card {
height: 400px;
width: 200px;
perspective: 50rem;
background-color: #fff;
box-shadow: 5px 10px 10px rgba(51, 51, 51, 0.8); }
.card--flip {
background: none;
box-shadow: none; }
.card__side {
width: 100%;
box-shadow: none;
background-color: #777;
transition: all 3s ease;
position: absolute;
top: 0;
left: 0;
backface-visibility: hidden; }
/* ADDED PSEUDO ELEMENT */
.card__side::after {
content: "";
position: absolute;
top: 0;
left: 0;
z-index: -10;
width: 100%;
height: 100%; }
.card__side--front::after {
box-shadow: 5px 10px 10px rgba(51, 51, 51, 0.8);
opacity: 1;
transition: all 3s ease; }
.card__side--back {
transform: rotateY(-180deg); }
.card__side--back::after {
box-shadow: 5px 10px 10px rgba(255, 0, 0, 0.8);
opacity: 0;
transition: all 3s ease; }
.card:hover .card__side--front {
transform: rotateY(180deg); }
.card:hover .card__side--front::after {
opacity: 0; }
.card:hover .card__side--back {
transform: rotateY(0); }
.card:hover .card__side--back::after {
opacity: 1; }
.card__header {
padding: 2rem; }
.card__main {
padding: 2rem; }
NOT WORKING
(added pseudo ::after class)
<div class="card card--flip">
<div class="card__side card__side--front">
<div class="card__header">
<h1>FRONT</h1>
</div>
<div class="card__main">front</div>
</div>
<div class="card__side card__side--back">
<div class="card__header">
<h1>BACK</h1>
</div>
<div class="card__main">back</div>
</div>
</div>
Add the following to your class:
.card {
...
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}

My transitions out are not working

My transition outs are not working, I am using the latest Chrome Browser and when I hover over the button, the transition in is working, however the transition out just cuts right off.
My CSS
.btn{
border-radius: 5px;
padding: 15px 25px;
font-size: 22px;
text-decoration: none;
margin: 20px;
color: #fff;
position: relative;
display: inline-block;
}
.btn:active{
transform: translate(0px, 5px);
-webkit-transform: translate(0px, 5px);
box-shadow: 0px 0px 0px 0px;
}
.blue{
background-color: #55acee;
box-shadow: 0px 5px 0px 0px #3C93D5;
}
.blue:hover{
background-color: #6FC6FF;
transition-duration: .02s;
display: inline-block;
}
}
HTML is on this JSFiddle.
You need to put the transition on the base state not the :hover then it will transition between all states.
.blue {
background-color: #55acee;
box-shadow: 0px 5px 0px 0px #3C93D5;
transition: background-color 0.2s ease-out;
}
.btn {
border-radius: 5px;
padding: 15px 25px;
font-size: 22px;
text-decoration: none;
margin: 20px;
color: #fff;
position: relative;
display: inline-block;
}
.btn:active {
transform: translate(0px, 5px);
-webkit-transform: translate(0px, 5px);
box-shadow: 0px 0px 0px 0px;
}
.blue {
background-color: #55acee;
box-shadow: 0px 5px 0px 0px #3C93D5;
transition: background-color 0.2s ease-out;
}
.blue:hover {
background-color: #6FC6FF;
display: inline-block;
}
<div id="buttons"> Blu
</div>
You are adding a transition to the :hover state, not to the actual element.
It's usually better to define a transition on the element itself, and then change properties to it's states, this way it understands that whatever the state change, it should transition from one to the other.
.btn{
transition: background-color 0.2s ease-out;
}
.btn:active{
...
}
.btn:hover{
...
}
Your just need to insert this on your btn main class
.btn{
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}

How to show tool tip on to the left side of DIV

Hello I have downloaded some codes from Google for a Tool tip for one of my DIVs.
In here the Tool tip is displaying on the top of DIV what I want is to display the Tool
tip on the left side of DIV and should has a long height.
I am Beginner to CSS i tried my best but I couldn't found the solution for it.
Please check the JSFIDDLE Link
CSS Code
.wrapper {
text-transform: uppercase;
background: #ececec;
color: #555;
cursor: help;
font-family: "Gill Sans", Impact, sans-serif;
font-size: 20px;
padding: 15px 20px;
position: relative;
width: 200px;
-webkit-transform: translateZ(0); /* webkit flicker fix */
-webkit-font-smoothing: antialiased; /* webkit text rendering fix */
}
.wrapper .tooltip {
background: #1496bb;
bottom: 100%;
color: #fff;
display: block;
left: -25px;
margin-bottom: 15px;
opacity: 0;
padding: 20px;
pointer-events: none;
position: absolute;
width: 100%;
-webkit-transform: translateY(10px);
-moz-transform: translateY(10px);
-ms-transform: translateY(10px);
-o-transform: translateY(10px);
transform: translateY(10px);
-webkit-transition: all .25s ease-out;
-moz-transition: all .25s ease-out;
-ms-transition: all .25s ease-out;
-o-transition: all .25s ease-out;
transition: all .25s ease-out;
-webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-ms-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-o-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
}
/* This bridges the gap so you can mouse into the tooltip without it disappearing */
.wrapper .tooltip:before {
bottom: -20px;
content: " ";
display: block;
height: 20px;
left: 0;
position: absolute;
width: 100%;
}
/* CSS Triangles - see Trevor's post */
.wrapper .tooltip:after {
border-left: solid transparent 10px;
border-right: solid transparent 10px;
border-top: solid #1496bb 10px;
bottom: -10px;
content: " ";
height: 0;
left: 50%;
margin-left: -13px;
position: absolute;
width: 0;
}
.wrapper:hover .tooltip {
opacity: 1;
pointer-events: auto;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
-o-transform: translateY(0px);
transform: translateY(0px);
}
/* IE can just show/hide with no transition */
.lte8 .wrapper .tooltip {
display: none;
}
.lte8 .wrapper:hover .tooltip {
display: block;
}
HTML Code
<br /><br /><br /><br /><br /><br /><br /><br />
<div class="wrapper">
<div class="tooltip">Here is the massage to be shown to the user Here is the massage to be shown to the user</div>
</div>
</div>
If I understood right, here's what you need:
http://jsfiddle.net/n6scfd6n/
.wrapper {
text-transform: uppercase;
background: #ececec;
color: #555;
cursor: help;
font-family:"Gill Sans", Impact, sans-serif;
font-size: 20px;
padding: 15px 20px;
position: relative;
width: 200px;
-webkit-transform: translateZ(0);
/* webkit flicker fix */
-webkit-font-smoothing: antialiased;
/* webkit text rendering fix */
margin-left: 15em;
}
.wrapper .tooltip {
background: #1496bb;
color: #fff;
display: block;
margin-bottom: 15px;
padding: 20px;
position: absolute;
width: 100%;
-webkit-transform: translateY(10px);
-moz-transform: translateY(10px);
-ms-transform: translateY(10px);
-o-transform: translateY(10px);
transform: translateY(10px);
-webkit-transition: all .25s ease-out;
-moz-transition: all .25s ease-out;
-ms-transition: all .25s ease-out;
-o-transition: all .25s ease-out;
transition: all .25s ease-out;
-webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-ms-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-o-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
margin-left: -16em;
margin-top: -4em;
opacity: 0;
}
/* This bridges the gap so you can mouse into the tooltip without it disappearing */
.wrapper .tooltip:before {
bottom: -20px;
content:" ";
display: block;
height: 20px;
left: 0;
position: absolute;
width: 100%;
}
/* CSS Triangles - see Trevor's post */
.wrapper .tooltip:after {
border-top: solid transparent 10px;
border-bottom: solid transparent 10px;
border-left: solid #1496bb 10px;
bottom: calc(50% - 5px);
content: " ";
height: 0;
left: 100%;
margin-left: 0px;
position: absolute;
width: 0;
}
.wrapper:hover .tooltip {
opacity: 1;
pointer-events: auto;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
-o-transform: translateY(0px);
transform: translateY(0px);
}
/* IE can just show/hide with no transition */
.lte8 .wrapper .tooltip {
display: none;
}
.lte8 .wrapper:hover .tooltip {
display: block;
}
Just updated -
http://jsfiddle.net/t570goyv/4/
.wrapper .tooltip:after {
border-bottom: solid transparent 10px;
border-top: solid transparent 10px;
border-left: solid #1496bb 10px;
bottom: 60px;
content: " ";
height: 0;
left: 104%;
margin-left: -13px;
position: absolute;
width: 0;
}
Check this working demo and let me know if its matching your requirement or not. I have just positioned the tooltip and arrow element, and changed the css animation from transitionY to transitionX.
CSS :
.wrapper {
text-transform: uppercase;
background: #ececec;
color: #555;
cursor: help;
font-family: "Gill Sans", Impact, sans-serif;
font-size: 20px;
float:right;
padding: 15px 20px;
position: relative;
width: 200px;
-webkit-transform: translateZ(0); /* webkit flicker fix */
-webkit-font-smoothing: antialiased; /* webkit text rendering fix */
}
.wrapper .tooltip {
background: #1496bb;
right: 110%;
color: #fff;
display: block;
opacity: 0;
padding: 20px;
pointer-events: none;
position: absolute;
width: 100%;
top: -180%;
-webkit-transform: translateX(10px);
-moz-transform: translateX(10px);
-ms-transform: translateX(10px);
-o-transform: translateX(10px);
transform: translateX(10px);
-webkit-transition: all .25s ease-out;
-moz-transition: all .25s ease-out;
-ms-transition: all .25s ease-out;
-o-transition: all .25s ease-out;
transition: all .25s ease-out;
-webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-ms-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
-o-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.28);
}
/* This bridges the gap so you can mouse into the tooltip without it disappearing */
.wrapper .tooltip:before {
bottom: -20px;
content: " ";
display: block;
height: 20px;
left: 0;
position: absolute;
width: 100%;
}
/* CSS Triangles - see Trevor's post */
.wrapper .tooltip:after {
border-top: solid transparent 10px;
border-bottom: solid transparent 10px;
border-left: solid #1496bb 10px;
content: " ";
height: 0;
top: 45%;
right:-10px;
position: absolute;
width: 0;
}
.wrapper:hover .tooltip {
opacity: 1;
pointer-events: auto;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
-o-transform: translateY(0px);
transform: translateY(0px);
}
/* IE can ju
st show/hide with no transition */
.lte8 .wrapper .tooltip {
display: none;
}
.lte8 .wrapper:hover .tooltip {
display: block;
}
Hope it helps.

Make numbers be seen as icons by browser

So I've got a little "intro" box that I styled effects for using fontawesome icons. The effect is nice and I would like to keep it, however later down the page I have a "stats" box and I want to use the same style & effect but using normal numbers so that the number can dynamically change via a php script. Of course, whenever I use normal numbers the effect doesn't work because I styled the CSS to work with the fontawesome icons. Is there a way to make the text parse as an icon, or do I need to rewrite my css?
HTML
<!-- Statistics -->
<div class="row">
<div class="span12 centre">
<h2 class="b-title">Some Statistics</h2><br /><br />
<!--Section 1-->
<div class="stats-box stats-box1">
<div class="text-center block-box">
<div class="stats-effect-inner"> <a class="stats-effect icon-unlock icon-3x" href="#"></a> </div>
<h3 style="text-decoration: none;">Domains</h3>
<p>The number of free domains given.</p>
<br />
</div>
</div>
</div>
Relative CSS is here. Full styling CSS is in the fiddle.
/*------------ Hover Effect Stats ------- */
.stats-effect { display: inline-block; font-size: 0px; cursor: pointer; margin: 15px 30px; width: 90px; height: 90px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; text-align: center; position: relative; z-index: 1; color: #fff; }
.stats-effect:after { pointer-events: none; position: absolute; width: 100%; height: 100%; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; content: ''; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; }
.stats-effect:before { speak: none; font-size: 48px; line-height: 90px; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; display: block; -webkit-font-smoothing: antialiased; }
/* Effect 1 */
.stats-effect-inner .stats-effect { background: rgba(255, 255, 255, 0.1); -webkit-transition: background 0.2s, color 0.2s; -moz-transition: background 0.2s, color 0.2s; transition: background 0.2s, color 0.2s; }
.stats-effect-inner .stats-effect:after { top: -7px; left: -7px; padding: 7px; -webkit-transition: -webkit-transform 0.2s, opacity 0.2s; -webkit-transform: scale(.8); -moz-transition: -moz-transform 0.2s, opacity 0.2s; -moz-transform: scale(.8); -ms-transform: scale(.8); transition: transform 0.2s, opacity 0.2s; transform: scale(.8); opacity: 0; -moz-box-shadow: 0 0 0 4px #ffffff;/*FF 3.5+*/ -webkit-box-shadow: 0 0 0 4px #ffffff;/*Saf3-4, Chrome, iOS 4.0.2-4.2, Android 2.3+*/ -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=90, Color=#ffffff)";/*IE 8*/ box-shadow: 0 0 0 4px #ffffff; filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=90, Color=#ffffff);/*IE 5.5-7*/
}
/* Effect */
.stats-box1:hover .stats-effect-inner .stats-effect, .stats-box2:hover .stats-effect-inner .stats-effect, .stats-box3:hover .stats-effect-inner .stats-effect { background: rgba(255, 255, 255, 1); color: #27CCC0; }
.stats-box1:hover .stats-effect-inner .stats-effect:after, .stats-box2:hover .stats-effect-inner .stats-effect:after, .stats-box3:hover .stats-effect-inner .stats-effect:after { -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); transform: scale(1); opacity: 1; }
/*------------ Icon Hover Effect ------- */
.stats-effect1 > img { padding: 20px; }
.stats-effect-inner1 { position: absolute; right: -33px; top: -33px; }
.stats-effect1 { background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #CCCCCC; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; color: #FF6850; cursor: pointer; display: inline-block; font-size: 0; height: 70px; margin: 12px 21px 15px 11px; position: relative; text-align: center; width: 70px; z-index: 1; }
.stats-effect1:after { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; content: ""; height: 100%; pointer-events: none; position: absolute; width: 100%; }
.stats-effect1:before { background: none repeat scroll 0 0 #FAFAFA; border-radius: 50% 50% 50% 50%; display: block; font-size: 48px; font-style: normal; font-variant: normal; font-weight: normal; line-height: 90px; text-transform: none; }
.stats-effect-inner1 .stats-effect { background: none repeat scroll 0 0 rgba(13, 30, 219, 0.1); transition: background 0.2s ease 0s, color 0.2s ease 0s; }
TL;DR - I want the icon within the circle in the box to be a normal text number but have the same effect when moused over.
Thanks so much for your help!
EDIT: UPDATED FIDDLE: Fiddle
EDIT: Minimized CSS: Fiddle