Make numbers be seen as icons by browser - html

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

Related

removing one pixel "border-radius" from button link

I have a problem when I try to use overflow: hidden; to hide a background effect on a button. I see one pixel around of border-radius in Chrome:
What can I do to hide these pixels? I can try to use box-shadow, but maybe you know an easier way.
JsFiddle
test
Css:
.btn {
margin: 20px;
padding: 10px 30px;
font-size: 14px;
text-transform: uppercase;
color: #fff;
border: 2px solid #f0913a;
-webkit-border-radius: 20px;
border-radius: 20px;
cursor: pointer;
overflow: hidden; /* <-- I try hide background but always get http://screencast.com/t/qktgZwmVtH */
}
.hvr-shutter-in-horizontal {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
background: #181818;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: .3s;
transition-duration: .3s;
}
.hvr-shutter-in-horizontal:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #f0913a;
-webkit-transform: scaleX(1);
transform: scaleX(1);
-webkit-transform-origin: 50%;
transform-origin: 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: .3s;
transition-duration: .3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-shutter-in-horizontal:active:before,
.hvr-shutter-in-horizontal:focus:before,
.hvr-shutter-in-horizontal:hover:before {
-webkit-transform: scaleX(0);
transform: scaleX(0);
}
you may use an inset shadow:
.btn {
margin: 20px;
padding: 10px 30px;
font-size: 14px;
text-transform: uppercase;
color: #fff;
border: 2px solid #f0913a;
border-radius: 20px;
cursor: pointer;
overflow:hidden;
}
.hvr-shutter-in-horizontal {
display: inline-block;
vertical-align: middle;
}
.hvr-shutter-in-horizontal:before {
content: "";
position: absolute;
z-index: -1;
top: -50px;
bottom: -50px;
left: 0px;
right: 0px;
background: #f0913a;
transition: 0.5s;
border-radius: inherit;
box-shadow: inset 0 0 0 0 #181818;
}
.hvr-shutter-in-horizontal:active:before,
.hvr-shutter-in-horizontal:focus:before,
.hvr-shutter-in-horizontal:hover:before {
box-shadow: inset 0 0 0 150px #181818;
}
test
it doesn't eradicate the bug , but the black is not there bleeding anymore.
to avoid the bug, Use another method, you may use a background-image such as a css gradient and resize it on hover (no pseudo involved either). example:
.btn {
margin: 20px;
padding: 10px 30px;
font-size: 14px;
text-transform: uppercase;
color: #fff;
border: 2px solid #f0913a;
-webkit-border-radius: 20px;
border-radius: 20px;
cursor: pointer;
overflow: hidden;
background: linear-gradient(black, black) left no-repeat, linear-gradient(black, black) right no-repeat #f0913a;
background-size: 0 100%;
transition: background-size 0.3s;
}
.hvr-shutter-in-horizontal {
display: inline-block;
vertical-align: middle;
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
}
.hvr-shutter-in-horizontal:active,
.hvr-shutter-in-horizontal:focus,
.hvr-shutter-in-horizontal:hover {
background-size: 100% 100%;
}
test
you just need to add background-clip:padding-box; on class .hvr-shutter-in-horizontal
CSS:
.btn {
margin: 20px;
padding: 10px 30px;
font-size: 14px;
text-transform: uppercase;
color: #fff;
border: 2px solid #f0913a;
-webkit-border-radius: 20px;
border-radius: 20px;
cursor: pointer;
overflow: hidden;
}
.hvr-shutter-in-horizontal {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
background: #181818;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: .3s;
transition-duration: .3s;
/* Prevent background color leak outs */
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
.hvr-shutter-in-horizontal:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #f0913a;
-webkit-transform: scaleX(1);
transform: scaleX(1);
-webkit-transform-origin: 50%;
transform-origin: 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: .3s;
transition-duration: .3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-shutter-in-horizontal:active:before,
.hvr-shutter-in-horizontal:focus:before,
.hvr-shutter-in-horizontal:hover:before {
-webkit-transform: scaleX(0);
transform: scaleX(0);
}
Demo on jsfiddle: https://jsfiddle.net/hamzanisar/wd9exfmx/9/
remove the overflow:hidden from the .btn class and change the left, right properties for the :before element, also set the border-radius to inherit for the :before element check the fiddle here for eg https://jsfiddle.net/0ap4qbrn/
.btn {
margin: 20px;
padding: 10px 30px;
font-size: 14px;
text-transform: uppercase;
color: #fff;
border: 2px solid #f0913a;
-webkit-border-radius: 20px;
border-radius: 20px;
cursor: pointer;
}
.hvr-shutter-in-horizontal {
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
background: #181818;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: .3s;
transition-duration: .3s;
}
.hvr-shutter-in-horizontal:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
bottom: 0;
left: -2px;/*equal to the border width of .btn but negated*/
right: -2px;/*equal to the border width of .btn but negated*/
background: #f0913a;
-webkit-transform: scaleX(1);
transform: scaleX(1);
-webkit-transform-origin: 50%;
transform-origin: 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: .3s;
transition-duration: .3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
border-radius: inherit;
}
.hvr-shutter-in-horizontal:active:before,
.hvr-shutter-in-horizontal:focus:before,
.hvr-shutter-in-horizontal:hover:before {
-webkit-transform: scaleX(0);
transform: scaleX(0);
}
give box-sizing:border-box; with webkit and moz prefix this may solve your issue

Increasing hit area of a link also increases text's underline

I am trying to increase the hit area of the link in the menu but doing so also increases the underline effect of the text. I have tried padding and width but no imrprovement. I want a effect just like the one present in highfive mobile menu(Underline from left). Here is the fiddle and Here is the code
.hvr-underline-from-left {
text-decoration:none;
padding: 3px 0;
color: #000;
cursor: pointer;
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
overflow: hidden;
}
.hvr-underline-from-left:before {
content: "";
position: absolute;
z-index: -1;
left: 0;
right: 100%;
bottom : 7px;
background: #E13F3F;
height: 2px;
-webkit-transition-property: right;
transition-property: right;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-underline-from-left:hover:before, .hvr-underline-from-left:focus:before, .hvr-underline-from-left:active:before {
right: 0;
}
<html>
<body>
<a class="hvr-underline-from-left" href="#">About </a>
</body>
</html>
You could add a span within the a-tag and put the underline effect on the span instead.
This way you can add padding to your link element without it affecting the underline effect.
a {
padding: 20px;
display: inline-block;
background: #eee;
}
.hvr-underline-from-left {
text-decoration: none;
padding: 3px 0;
color: #000;
cursor: pointer;
display: inline-block;
vertical-align: middle;
-webkit-transform: translateZ(0);
transform: translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
position: relative;
overflow: hidden;
}
.hvr-underline-from-left:before {
content: "";
position: absolute;
z-index: -1;
left: 0;
right: 100%;
bottom: 7px;
background: #E13F3F;
height: 2px;
-webkit-transition-property: right;
transition-property: right;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
a:hover .hvr-underline-from-left:before,
.hvr-underline-from-left:focus:before,
.hvr-underline-from-left:active:before {
right: 0;
}
<html>
<body>
<span class="hvr-underline-from-left">About</span>
</body>
</html>

Hover effect on circle container

I have a circle with a hover effect on it and some text under. Now what I'm trying to achieve is to trigger that hover effect when you rollover the entire circle container and not only the circle itself.
DEMO
http://jsfiddle.net/kL0vxrxL/
.icon-circle-box {
text-align: center;
margin: 0 auto 130px;
}
.icon-circle {
display: inline-block;
font-size: 42px;
cursor: pointer;
margin: 0 0 28px;
width: 100px;
height: 100px;
line-height: 100px;
border-radius: 50%;
text-align: center;
position: relative;
z-index: 1;
color: #fff;
}
.icon-circle-box p {
margin-top: 13px;
}
.icon-circle:after {
pointer-events: none;
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
content: '';
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.icon-circle:before {
font-family: 'lineicons';
speak: none;
font-size: 42px;
line-height: 100px;
display: block;
}
.circle-effect .icon-circle {
color: #000;
box-shadow: 0 0 0 2px #000;
-webkit-transition: color 0.3s;
-moz-transition: color 0.3s;
transition: color 0.3s;
}
.circle-effect .icon-circle:after {
top: -2px;
left: -2px;
padding: 2px;
z-index: -1;
background: #000;
opacity: 0;
filter: alpha(opacity=0);
-webkit-transition: -webkit-transform 0.2s, opacity 0.2s;
-moz-transition: -moz-transform 0.2s, opacity 0.2s;
transition: transform 0.2s, opacity 0.2s;
}
.icon-circle:hover {
color: #fff;
}
.icon-circle:hover:after {
-webkit-transform: scale(0.85);
-moz-transform: scale(0.85);
-ms-transform: scale(0.85);
transform: scale(0.85);
opacity: 1;
filter: alpha(opacity=100);
}
<div class="icon-circle-box circle-effect">
<p>Donec id elit non mi porta gravida at eget metus.</p>
</div>
I'm trying to achieve is to trigger that hover effect when you rollover the entire circle container and not only the circle itself.
Then you would add the :hover pseudo-class to the parent element, .icon-circle-box.
Updated Example
.icon-circle-box:hover .icon-circle:after {
-webkit-transform: scale(0.85);
-moz-transform: scale(0.85);
-ms-transform: scale(0.85);
transform: scale(0.85);
opacity: 1;
filter: alpha(opacity=100);
}

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.

Is this a CSS bug? Left border not showing up

I have the following problem: when I first select one of the two boxes the left border is missing (Google Chrome 36); after I select the other one the left border appears.
JSFIDDLE:
http://jsfiddle.net/emrfcuu7/
Observe that immediately after compiling the code - when selecting one of the two boxes the left border is missing; is this a bug or am I doing something wrong?
#import url(http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,300,400,600,700,800);
.main {
position: relative;
background-color: #16A085;
width: 550px;
height: 350px;
}
.mainRibbon {
position: relative;
background-color: #ECF0F1;
width: 70%;
height: 60%;
margin: 0 auto;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
border-radius: 6px;
}
.textBoxStyle {
position: relative;
border: 1px solid rgba(26, 188, 156, 0);
border-radius: 4px;
width: 80%;
text-indent: 20px;
box-shadow: none;
-webkit-box-shadow: none;
line-height: 1.4285;
-webkit-transition: border-color .25s linear;
transition: border-color .25s linear;
margin: 6% 10% 0 10%;
padding-top: 6px;
padding-bottom: 6px;
}
.textBoxStyle:focus {
outline: 0;
border-color: rgba(26, 188, 156, 1);
}
.btnLogin {
background-color: #16A085;
width: 80%;
border-radius: 6px;
margin: 6% 10% 0 10%;
-webkit-transition: background .25s linear;
transition: background .25s linear;
}
.btnLogin:hover {
background-color: #1ABC9C;
cursor: pointer;
cursor: hand;
}
.btnLogin>p {
color: white;
margin: 0;
padding-top: 1%;
padding-bottom: 1%;
font-family: 'Open Sans';
-webkit-font-smoothing: subpixel-antialiased;
font-size: 17px;
text-align: center;
}
.icon {
position: absolute;
background: rgba(0, 0, 0, 0);
width: auto;
height: auto;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.icon>p {
color: white;
font-size: 60px;
line-height: 60px;
padding: 0;
margin: 0;
}
/*de sters
.test{
position:relative;
background-color:blue;
width:80%;
height:30%;
top:50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}*/
<div class="main">
<div class="icon">
<p class="text icon"></p>
</div>
<div class="mainRibbon">
<input type="text" class="textBoxStyle" placeholder="Enter your username">
<input type="text" class="textBoxStyle" placeholder="Password">
<div class="btnLogin">
<p>Log in</p>
</div>
</div>
</div>
Problem solved: the issue is that "left-margin" is falling on half-pixel and thus cannot be displayed; I changed "width" from ".main" from "550px" to "560px" and now the left margin displays perfectly;
Thanks to all that suggested to style "outline" to fit my style; it is a good solution only that outline can not have rounded corners as I desire.
I don't know exactly why it is doing that but when you add padding-left:1px to .textBoxStyle, it fixes the problem but not at all times, very wierd.
http://jsfiddle.net/emrfcuu7/3/
ALso I saw that the problem may come from margin:6% 10% 0% 10%;, maybe there is not enough space for the border with these margins and you should use pixels margins
Update
The real solution:
You must remove outline:0 from .textBoxStyle:focus and have this :
.textBoxStyle:focus{
border-color:rgba(26,188,156,1);
}
http://jsfiddle.net/emrfcuu7/7/
give border more than 1px
.textBoxStyle{
position:relative;
border:2px solid rgba(26,188,156,0);
border-radius:4px;
width:80%;
text-indent:20px;
box-shadow:none;
-webkit-box-shadow:none;
line-height:1.4285;
-webkit-transition: border-color .25s linear;
transition: border-color .25s linear;
margin:6% 10% 0 10%;
padding-top:6px;
padding-bottom:6px;
}
the issue is not reproducible if margins are removed.
margin:6% 10% 0 10%;
Make use of this fiddle
.textBoxStyle:focus{
outline:none;
border:2px solid rgba(26,188,156,1);
}