I have found a sidebar and have insert a link. Here you can see a sample.
But the link doesn't work because the sidebar overlays the link. What can I do to resolve this problem?
z-index is not working for me.
a {
color: #fff;
text-decoration: none;
}
.me {
width: 400px;
margin: 90px auto;
}
.me p,
.me h1 {
text-transform: uppercase;
letter-spacing: 3px;
text-align: center;
}
.me p {
font-weight: 200;
}
.me span {
font-weight: bold;
}
.social {
position: fixed;
top: 20px;
}
.social ul {
padding: 0px;
-webkit-transform: translate(-270px, 0);
-moz-transform: translate(-270px, 0);
-ms-transform: translate(-270px, 0);
-o-transform: translate(-270px, 0);
transform: translate(-270px, 0);
}
.social ul li {
display: block;
margin: 5px;
background: rgba(0, 0, 0, 0.36);
width: 300px;
text-align: right;
padding: 10px;
-webkit-border-radius: 0 30px 30px 0;
-moz-border-radius: 0 30px 30px 0;
border-radius: 0 30px 30px 0;
-webkit-transition: all 1s;
-moz-transition: all 1s;
-ms-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;
}
.social ul li:hover {
-webkit-transform: translate(110px, 0);
-moz-transform: translate(110px, 0);
-ms-transform: translate(110px, 0);
-o-transform: translate(110px, 0);
transform: translate(110px, 0);
background: rgba(255, 255, 255, 0.4);
}
.social ul li:hover a {
color: #000;
}
.social ul li:hover i {
color: #fff;
background: rgba(0, 0, 0, 0.36);
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
-webkit-transition: all 1s;
-moz-transition: all 1s;
-ms-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;
}
.social ul li i {
margin-left: 10px;
color: #000;
background: #fff;
padding: 10px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
width: 20px;
height: 20px;
font-size: 20px;
background: #ffffff;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
body {
background: #25343F;
color: #fff;
font-family: 'Raleway', sans-serif;
}
<link href='http://fonts.googleapis.com/css?family=Raleway:400,200' rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<div>
<br />
<br />
<br />a link who don't work becauce overlay
</div>
<nav class="social">
<ul>
<li>Twitter <i class="fa fa-twitter"></i>
</li>
<li>Facebook <i class="fa fa-facebook"></i>
</li>
<li>Dribbble <i class="fa fa-dribbble"></i>
</li>
<li>Behance <i class="fa fa-behance"></i>
</li>
</ul>
</nav>
<div class="me">
<p>Created by:
<p>
<h1>Gian Di Serafino</h1>
<p>for <span>Informartion architecture</span>
</p>
</div>
You need to give the div a position. In order not to mess with z-indexes, put the div after the sidebar.
div.problematic_div {
position:relative;
}
But I recommend you to check how you are positioning your elements.
div.problematic_div {
position: relative;
}
a {
color: #fff;
text-decoration: none;
}
.me {
width: 400px;
margin: 90px auto;
}
.me p,
.me h1 {
text-transform: uppercase;
letter-spacing: 3px;
text-align: center;
}
.me p {
font-weight: 200;
}
.me span {
font-weight: bold;
}
.social {
position: fixed;
top: 20px;
}
.social ul {
padding: 0px;
-webkit-transform: translate(-270px, 0);
-moz-transform: translate(-270px, 0);
-ms-transform: translate(-270px, 0);
-o-transform: translate(-270px, 0);
transform: translate(-270px, 0);
}
.social ul li {
display: block;
margin: 5px;
background: rgba(0, 0, 0, 0.36);
width: 300px;
text-align: right;
padding: 10px;
-webkit-border-radius: 0 30px 30px 0;
-moz-border-radius: 0 30px 30px 0;
border-radius: 0 30px 30px 0;
-webkit-transition: all 1s;
-moz-transition: all 1s;
-ms-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;
}
.social ul li:hover {
-webkit-transform: translate(110px, 0);
-moz-transform: translate(110px, 0);
-ms-transform: translate(110px, 0);
-o-transform: translate(110px, 0);
transform: translate(110px, 0);
background: rgba(255, 255, 255, 0.4);
}
.social ul li:hover a {
color: #000;
}
.social ul li:hover i {
color: #fff;
background: rgba(0, 0, 0, 0.36);
-webkit-transform: rotate(360deg);
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-o-transform: rotate(360deg);
transform: rotate(360deg);
-webkit-transition: all 1s;
-moz-transition: all 1s;
-ms-transition: all 1s;
-o-transition: all 1s;
transition: all 1s;
}
.social ul li i {
margin-left: 10px;
color: #000;
background: #fff;
padding: 10px;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
width: 20px;
height: 20px;
font-size: 20px;
background: #ffffff;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}
body {
background: #25343F;
color: #fff;
font-family: 'Raleway', sans-serif;
}
<link href='http://fonts.googleapis.com/css?family=Raleway:400,200' rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<nav class="social">
<ul>
<li>Twitter <i class="fa fa-twitter"></i>
</li>
<li>Facebook <i class="fa fa-facebook"></i>
</li>
<li>Dribbble <i class="fa fa-dribbble"></i>
</li>
<li>Behance <i class="fa fa-behance"></i>
</li>
</ul>
</nav>
<div class="problematic_div">
<br />
<br />
<br />a link who don't work becauce overlay
</div>
<div class="me">
<p>Created by:
<p>
<h1>Gian Di Serafino</h1>
<p>for <span>Informartion architecture</span>
</p>
</div>
Related
I've been fiddling with this code for two days now but whatever I do I can't get this off-canvas nav toggle to take me to the same #section of the website as the normal nav menu.
Here's the html:
<div id="page">
<nav class="fh5co-nav">
<!-- <div class="top-menu"> -->
<div class="container">
<div class="row">
<div class="col-xs-12 text-center logo-wrap">
<div id="fh5co-logo">Woodbridge Art Services</div>
</div>
<div class="col-xs-12 text-center menu-1 menu-wrap">
<ul>
<li class="menu-active"></li>
<li>Consultation</li>
<li>Installation</li>
<li>Sourcing</li>
<li>Transportation</li>
<li>Contact</li>
<li>07905 468747</li>
</ul>
</div>
<!-- </div> -->
</nav>
Here's the css style for the offcanvas:
#fh5co-offcanvas {
position: absolute;
z-index: 1901;
width: 270px;
background: #000 ;
top: 0;
right: 0;
top: 0;
bottom: 0;
padding: 75px 40px 40px 40px;
overflow-y: auto;
display: none;
-moz-transform: translateX(270px);
-webkit-transform: translateX(270px);
-ms-transform: translateX(270px);
-o-transform: translateX(270px);
transform: translateX(270px);
-webkit-transition: 0.5s;
-o-transition: 0.5s;
transition: 0.5s;
}
#media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
#fh5co-offcanvas {
background: #000 url(../images/broken_noise.png) repeat;
}
}
#media screen and (max-width: 768px) {
#fh5co-offcanvas {
display: block;
}
}
.offcanvas #fh5co-offcanvas {
-moz-transform: translateX(0px);
-webkit-transform: translateX(0px);
-ms-transform: translateX(0px);
-o-transform: translateX(0px);
transform: translateX(0px);
}
#fh5co-offcanvas a {
color: rgba(255, 255, 255, 0.5);
}
#fh5co-offcanvas a:hover {
color: rgba(255, 255, 255, 0.8);
}
#fh5co-offcanvas ul {
padding: 0;
margin: 0;
}
#fh5co-offcanvas ul li {
padding: 0;
margin: 0;
list-style: none;
}
#fh5co-offcanvas ul li > ul {
padding-left: 20px;
display: none;
}
#fh5co-offcanvas ul li.offcanvas-has-dropdown > a {
display: block;
position: relative;
}
#fh5co-offcanvas ul li.offcanvas-has-dropdown > a:after {
position: absolute;
right: 0px;
font-family: 'icomoon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
content: "\ebfc";
font-size: 20px;
color: rgba(255, 255, 255, 0.2);
-webkit-transition: 0.5s;
-o-transition: 0.5s;
transition: 0.5s;
}
#fh5co-offcanvas ul li.offcanvas-has-dropdown.active a:after {
-webkit-transform: rotate(-180deg);
-moz-transform: rotate(-180deg);
-ms-transform: rotate(-180deg);
-o-transform: rotate(-180deg);
transform: rotate(-180deg);
}
And here's the script for the toggle:
.fh5co-nav-toggle {
width: 25px;
height: 25px;
cursor: pointer;
text-decoration: none;
top: 25px !important;
}
.fh5co-nav-toggle.active i::before, .fh5co-nav-toggle.active i::after {
background: #444;
}
.fh5co-nav-toggle:hover, .fh5co-nav-toggle:focus, .fh5co-nav-toggle:active {
outline: none;
border-bottom: none !important;
}
.fh5co-nav-toggle i {
position: relative;
display: inline-block;
width: 25px;
height: 2px;
color: #252525;
font: bold 14px/.4 Helvetica;
text-transform: uppercase;
text-indent: -55px;
background: #252525;
transition: all .2s ease-out;
}
.fh5co-nav-toggle i::before, .fh5co-nav-toggle i::after {
content: '';
width: 25px;
height: 2px;
background: #252525;
position: absolute;
left: 0;
transition: all .2s ease-out;
}
.fh5co-nav-toggle.fh5co-nav-black > i {
color: #fff;
background: #fff;
}
.fh5co-nav-toggle.fh5co-nav-black > i::before, .fh5co-nav-toggle.fh5co-nav-black > i::after {
background: #fff;
}
.fh5co-nav-toggle i::before {
top: -7px;
}
.fh5co-nav-toggle i::after {
bottom: -7px;
}
.fh5co-nav-toggle:hover i::before {
top: -10px;
}
.fh5co-nav-toggle:hover i::after {
bottom: -10px;
}
.fh5co-nav-toggle.active i {
background: transparent;
}
.fh5co-nav-toggle.active i::before {
top: 0;
-webkit-transform: rotateZ(45deg);
-moz-transform: rotateZ(45deg);
-ms-transform: rotateZ(45deg);
-o-transform: rotateZ(45deg);
transform: rotateZ(45deg);
background: #fff;
}
.fh5co-nav-toggle.active i::after {
bottom: 0;
-webkit-transform: rotateZ(-45deg);
-moz-transform: rotateZ(-45deg);
-ms-transform: rotateZ(-45deg);
-o-transform: rotateZ(-45deg);
transform: rotateZ(-45deg);
background: #fff;
}
.fh5co-nav-toggle {
position: absolute;
right: 0px;
top: 65px;
z-index: 21;
padding: 6px 0 0 0;
display: block;
margin: 0 auto;
display: none;
height: 44px;
width: 44px;
z-index: 2001;
border-bottom: none !important;
}
#media screen and (max-width: 768px) {
.fh5co-nav-toggle {
display: block;
}
}
At the moment the menu opens and shows the various links yet when you click on them they go to the section of the website they're targetted to however you can't then scroll up or down and when you click on the screen it goes back to the toggle menu. Also the images for each section don't show up...
Look forward to seeing what my glaring failure is in this as I know it'll likely be one line or a <div/> in the wrong place.
Cheers guys
Anyone know why this wont work correctly? The dropdown should only appear when you hovet on the menu name but it appears if you hover below the item name and the longer the menu list the further beneath it you can hover to make it drop down. For example if you hover below the menu name "skills" the dropdown appears instead of only appearing when you click ON the name or hover over it.
<!DOCTYPE html>
<html>
<head>
<style>
$min-width: 120px;
$secondarycolor: #CCFF00;
$thirdcolor: #000000;
#mixin transform($value) {
-webkit-transform: ($value);
-moz-transform: ($value);
-ms-transform: ($value);
transform: ($value);
}
#mixin transition($value) {
-webkit-transition: ($value);
-moz-transition: ($value);
-ms-transition: ($value);
transition: ($value);
}
*{
box-sizing: border-box;
}
body {
font-family: 'Open Sans', sans-serif;
color: #CCFF00;
background: #374954;
text-align: center;
}
#main {
position: relative;
list-style: none;
background-image: url('https://tc-boxing.com/pic/gradient.png');
background-repeat: repeat-x no-repeat-y;
font-weight: 600;
font-size: 0;
text-transform: uppercase;
display: inline-block;
padding: 0;
margin: 50px auto;
li {
font-size: 0.8rem;
display: inline-block;
position: relative;
padding: 15px 20px;
cursor: pointer;
z-index: 5;
min-width: $min-width;
}
}
li {
margin: 0;
}
.drop {
overflow: hidden;
list-style: none;
position: absolute;
padding: 0;
width: 100%;
left: 0;
top: 48px;
div {
#include transform(translate(0,-100%));
#include transition(all 0.5s 0.1s);
position: relative;
}
li {
display:block;
padding: 0;
width: 100%;
background-image: url('https://tc-boxing.net/pic/gradientdd2.png') !important;
background-repeat: repeat-x no-repeat-y;
}
}
#marker {
height: 6px;
background: $secondarycolor !important;
position: absolute;
bottom: 0;
width: $min-width;
z-index: 2; #include transition(all 0.35s);
}
#for $i from 1 through 4 {
#main li:nth-child(#{$i}) {
&:hover ul div {
#include transform(translate(0,0));
}
&:hover ~ #marker {
#include transform(translate(#{(-1+$i)*$min-width},0));
}
}
}
* {
box-sizing: border-box;
}
body {
font-family: 'Open Sans', sans-serif;
background: #374954;
color: #CCFF00;
text-align: center;
}
#main {
position: relative;
list-style: none;
background-image: url('https://tc-boxing.com/pic/gradient.png');
background-repeat: repeat-x no-repeat-y;
font-weight: 600;
font-size: 0;
text-transform: uppercase;
display: inline-block;
padding: 0;
margin: 50px auto;
}
#main li {
font-size: 0.8rem;
display: inline-block;
position: relative;
padding: 15px 20px;
cursor: pointer;
z-index: 5;
min-width: 120px;
}
li {
margin: 0;
}
.drop {
overflow: hidden;
list-style: none;
position: absolute;
padding: 0;
width: 100%;
left: 0;
top: 48px;
}
.drop div {
-webkit-transform: translate(0, -100%);
-moz-transform: translate(0, -100%);
-ms-transform: translate(0, -100%);
transform: translate(0, -100%);
-webkit-transition: all 0.5s 0.1s;
-moz-transition: all 0.5s 0.1s;
-ms-transition: all 0.5s 0.1s;
transition: all 0.5s 0.1s;
position: relative;
}
.drop li {
display: block;
padding: 0;
width: 100%;
background-image: url('https://tc-boxing.net/pic/gradientdd.png') !important;
background-repeat: repeat-x no-repeat-y;
}
#marker {
height: 4px;
background: #CCFF00 !important;
position: absolute;
bottom: 0;
width: 120px;
z-index: 2;
-webkit-transition: all 0.35s;
-moz-transition: all 0.35s;
-ms-transition: all 0.35s;
transition: all 0.35s;
}
#main li:nth-child(1):hover ul div {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
#main li:nth-child(1):hover ~ #marker {
-webkit-transform: translate(0px, 0);
-moz-transform: translate(0px, 0);
-ms-transform: translate(0px, 0);
transform: translate(0px, 0);
}
#main li:nth-child(2):hover ul div {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
#main li:nth-child(2):hover ~ #marker {
-webkit-transform: translate(120px, 0);
-moz-transform: translate(120px, 0);
-ms-transform: translate(120px, 0);
transform: translate(120px, 0);
}
#main li:nth-child(3):hover ul div {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
#main li:nth-child(3):hover ~ #marker {
-webkit-transform: translate(240px, 0);
-moz-transform: translate(240px, 0);
-ms-transform: translate(240px, 0);
transform: translate(240px, 0);
}
#main li:nth-child(4):hover ul div {
-webkit-transform: translate(0, 0);
-moz-transform: translate(0, 0);
-ms-transform: translate(0, 0);
transform: translate(0, 0);
}
#main li:nth-child(4):hover ~ #marker {
-webkit-transform: translate(360px, 0);
-moz-transform: translate(360px, 0);
-ms-transform: translate(360px, 0);
transform: translate(360px, 0);
}
</style>
</head>
<body>
<!-- not responsive yet -->
<nav>
<ul id="main">
<li>Home</li>
<li>About</li>
<li>Skills
<ul class="drop">
<div>
<li>scss</li>
<li>jquery</li>
<li>html</li>
</div>
</ul>
</li>
<li>Contact</li>
<div id="marker"></div>
</ul>
</nav>
</body>
</html>
https://codepen.io/dghez/pen/Kwoper
Try adding::
#main li {
visibility: hidden;
}
#main li:hover ul {
visibility: visible;
}
I have a grid of hexagons that don't display hover effects when their shape is changed to squares. I am using the effects from this library https://github.com/IanLunn/Hover ( https://cdn.bootcss.com/hover.css/2.1.1/css/hover.css )
Does anyone know how to fix this?
Any help would be appreciated. Cheers............................................................................................................................................................
/* grid of hexagons */
.hex-background {
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.hex-background .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
}
.hex-background:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid {
width: 90%;
max-width: 1000px;
margin: 0 auto;
padding: 0;
}
.grid li {
list-style-type: none;
position: relative;
float: left;
width: 18%;
padding-bottom: 20.78461%;
-o-transform: rotate(-60deg) skewY(30deg);
-moz-transform: rotate(-60deg) skewY(30deg);
-webkit-transform: rotate(-60deg) skewY(30deg);
-ms-transform: rotate(-60deg) skewY(30deg);
transform: rotate(-60deg) skewY(30deg);
overflow: hidden;
visibility: hidden;
}
.grid li:nth-child(2n) {
margin: 0 1%;
}
.grid li:nth-child(10n+6),
.grid li:nth-child(10n+7),
.grid li:nth-child(10n+8),
.grid li:nth-child(10n+9),
.grid li:nth-child(10n+10) {
margin-top: -4.5%;
margin-bottom: -4.5%;
-o-transform: translateX(48%) rotate(-60deg) skewY(30deg);
-moz-transform: translateX(48%) rotate(-60deg) skewY(30deg);
-webkit-transform: translateX(48%) rotate(-60deg) skewY(30deg);
-ms-transform: translateX(48%) rotate(-60deg) skewY(30deg);
transform: translateX(48%) rotate(-60deg) skewY(30deg);
}
.grid li .hexagon {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
-o-transform: skewY(-30deg) rotate(60deg);
-moz-transform: skewY(-30deg) rotate(60deg);
-webkit-transform: skewY(-30deg) rotate(60deg);
-ms-transform: skewY(-30deg) rotate(60deg);
transform: skewY(-30deg) rotate(60deg);
overflow: hidden;
/*background images*/
}
.grid li .hexagon.img1 {
background: url("https://c2.staticflickr.com/6/5560/15235542331_fbe56a772e_b.jpg");
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.grid li .hexagon.img1 .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
}
.grid li .hexagon.img1:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid li .hexagon.img2 {
background: url("https://c2.staticflickr.com/8/7490/16150657349_cf9be4ce7e_b.jpg");
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.grid li .hexagon.img2 .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
}
.grid li .hexagon.img2:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid li .hexagon.img3 {
background: url("https://c2.staticflickr.com/6/5205/5262879347_26a831f439_b.jpg");
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.grid li .hexagon.img3 .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
}
.grid li .hexagon.img3:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid li * {
visibility: visible;
}
.grid li p {
transform: translateY(100%);
text-align: center;
color: #fff;
}
.clear:after {
content: "";
display: block;
clear: both;
}
#media only screen and (max-width: 768px) {
.grid li {
display: inline-block;
width: 49%;
padding: 0;
height: 35%;
padding-bottom: 0%;
-o-transform: none;
-moz-transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
overflow: visible;
visibility: visible;
padding-bottom: 2%;
}
.grid li:nth-child(2n+1) {
margin-right: 2%;
}
.grid li:nth-child(2n) {
margin: 0 0%;
}
.grid li .hexagon {
position: relative;
top: none;
left: none;
width: 100%;
height: 200px;
-o-transform: none;
-moz-transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
}
.grid li:nth-child(10n+6),
.grid li:nth-child(10n+7),
.grid li:nth-child(10n+8),
.grid li:nth-child(10n+9),
.grid li:nth-child(10n+10) {
margin-top: 0%;
margin-bottom: 0%;
-o-transform: none;
-moz-transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
}
}
#media only screen and (max-width: 400px) {
.grid li {
display: inline-block;
width: 100%;
height: 35%;
padding-bottom: 10px;
}
.grid li:nth-child(2n+1) {
margin-right: 0%;
}
}
/*hover effects*/
/*!
* Hover.css (http://ianlunn.github.io/Hover/)
* Version: 2.2.0
* Author: Ian Lunn #IanLunn
* Author URL: http://ianlunn.co.uk/
* Github: https://github.com/IanLunn/Hover
* Hover.css Copyright Ian Lunn 2017. Generated with LESS.
*/
/* Sweep To Right */
.hvr-sweep-to-right {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-sweep-to-right:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #2693ff;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: 0 50%;
transform-origin: 0 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sweep-to-right:hover,
.hvr-sweep-to-right:focus,
.hvr-sweep-to-right:active {
color: white;
}
.hvr-sweep-to-right:hover:before,
.hvr-sweep-to-right:focus:before,
.hvr-sweep-to-right:active:before {
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
/* Sweep To Bottom */
.hvr-sweep-to-bottom {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-sweep-to-bottom:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #2693ff;
-webkit-transform: scaleY(0);
transform: scaleY(0);
-webkit-transform-origin: 50% 0;
transform-origin: 50% 0;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sweep-to-bottom:hover,
.hvr-sweep-to-bottom:focus,
.hvr-sweep-to-bottom:active {
color: white;
}
.hvr-sweep-to-bottom:hover:before,
.hvr-sweep-to-bottom:focus:before,
.hvr-sweep-to-bottom:active:before {
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
/* Radial Out */
.hvr-radial-out {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
overflow: hidden;
background: #e1e1e1;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-radial-out:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #2693ff;
border-radius: 100%;
-webkit-transform: scale(0);
transform: scale(0);
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-radial-out:hover,
.hvr-radial-out:focus,
.hvr-radial-out:active {
color: white;
}
.hvr-radial-out:hover:before,
.hvr-radial-out:focus:before,
.hvr-radial-out:active:before {
-webkit-transform: scale(2);
transform: scale(2);
}
/* Shutter Out Horizontal */
.hvr-shutter-out-horizontal {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
background: #e1e1e1;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-shutter-out-horizontal:before {
content: "";
position: absolute;
z-index: -1;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #2693ff;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: 50%;
transform-origin: 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-shutter-out-horizontal:hover,
.hvr-shutter-out-horizontal:focus,
.hvr-shutter-out-horizontal:active {
color: white;
}
.hvr-shutter-out-horizontal:hover:before,
.hvr-shutter-out-horizontal:focus:before,
.hvr-shutter-out-horizontal:active:before {
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
<!doctype html>
<html>
<head>
<!--<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/hover.css/2.1.1/css/hover.css">-->
</head>
<body>
<ul class="grid">
<li>
<div class="hexagon img1 hvr-sweep-to-right"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-sweep-to-bottom"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-radial-out"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img1 hvr-shutter-out-horizontal"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-sweep-to-right"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-sweep-to-bottom"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img1 hvr-radial-out"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-shutter-out-horizontal"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-sweep-to-right"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img1 hvr-sweep-to-bottom"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-radial-out"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-shutter-out-horizontal"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img1 hvr-sweep-to-right"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-sweep-to-bottom"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-radial-out"><div class="text">Hello World</div></div>
</li>
</ul>
</body>
</html>
I think hover does not works on mobile devices. Because :hover requires a pointer to activate.
There are more details here
You should use :active pseudo class for mobile insted of :hover
Also it's good to put cursor: pointer;
Keep in mind also this specific behaviour for iphone - How to make my 'click' function work with iOS
Ok I found the issue. Its to do with the z-index of the background effect. For example for hvr-shutter-out-horizontal, in the css class .hvr-shutter-out-horizontal:before { } change the z-index to something like z-index: 5 instead of -1. Then in .grid li .hexagon.img1 .text change it to a higher z index like z-index:10 so the text is visible in front. Working solution here. Using this fix means you should be able to use any of the css hover effects in this library https://github.com/IanLunn/Hover
/* grid of hexagons */
.grid {
width: 90%;
max-width: 1000px;
margin: 0 auto;
padding: 0;
}
.grid li {
list-style-type: none;
position: relative;
float: left;
width: 18%;
padding-bottom: 20.78461%;
-o-transform: rotate(-60deg) skewY(30deg);
-moz-transform: rotate(-60deg) skewY(30deg);
-webkit-transform: rotate(-60deg) skewY(30deg);
-ms-transform: rotate(-60deg) skewY(30deg);
transform: rotate(-60deg) skewY(30deg);
overflow: hidden;
visibility: hidden;
}
.grid li:nth-child(2n) {
margin: 0 1%;
}
.grid li:nth-child(10n+6),
.grid li:nth-child(10n+7),
.grid li:nth-child(10n+8),
.grid li:nth-child(10n+9),
.grid li:nth-child(10n+10) {
margin-top: -4.5%;
margin-bottom: -4.5%;
-o-transform: translateX(48%) rotate(-60deg) skewY(30deg);
-moz-transform: translateX(48%) rotate(-60deg) skewY(30deg);
-webkit-transform: translateX(48%) rotate(-60deg) skewY(30deg);
-ms-transform: translateX(48%) rotate(-60deg) skewY(30deg);
transform: translateX(48%) rotate(-60deg) skewY(30deg);
}
.grid li .hexagon {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
-o-transform: skewY(-30deg) rotate(60deg);
-moz-transform: skewY(-30deg) rotate(60deg);
-webkit-transform: skewY(-30deg) rotate(60deg);
-ms-transform: skewY(-30deg) rotate(60deg);
transform: skewY(-30deg) rotate(60deg);
overflow: hidden;
/*background images*/
}
.grid li .hexagon.img1 {
background: url("https://c2.staticflickr.com/6/5560/15235542331_fbe56a772e_b.jpg");
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.grid li .hexagon.img1 .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
z-index: 10;
position: relative;
}
.grid li .hexagon.img1:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid li .hexagon.img2 {
background: url("https://c2.staticflickr.com/8/7490/16150657349_cf9be4ce7e_b.jpg");
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.grid li .hexagon.img2 .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
z-index: 10;
position: relative;
}
.grid li .hexagon.img2:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid li .hexagon.img3 {
background: url("https://c2.staticflickr.com/6/5205/5262879347_26a831f439_b.jpg");
background-size: cover;
background-position: center;
display: inline-block;
cursor: pointer;
}
.grid li .hexagon.img3 .text {
opacity: 0;
font-family: 'Source Sans Pro', sans-serif;
font-weight: 300;
font-size: 20px;
z-index: 10;
position: relative;
}
.grid li .hexagon.img3:hover .text {
text-align: center;
margin-top: 51%;
opacity: 1;
-moz-transition: opacity 0.5s ease-in-out;
-webkit-transition: opacity 0.5s ease-in-out;
-o-transition: opacity 0.5s ease-in-out;
transition: opacity 0.5s ease-in-out;
}
.grid li * {
visibility: visible;
}
.grid li p {
transform: translateY(100%);
text-align: center;
color: #fff;
}
.clear:after {
content: "";
display: block;
clear: both;
}
#media only screen and (max-width: 768px) {
.grid li {
display: inline-block;
width: 49%;
padding: 0;
height: 35%;
padding-bottom: 0%;
-o-transform: none;
-moz-transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
overflow: visible;
visibility: visible;
padding-bottom: 2%;
}
.grid li:nth-child(2n+1) {
margin-right: 2%;
}
.grid li:nth-child(2n) {
margin: 0 0%;
}
.grid li .hexagon {
position: relative;
top: none;
left: none;
width: 100%;
height: 200px;
-o-transform: none;
-moz-transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
}
.grid li:nth-child(10n+6),
.grid li:nth-child(10n+7),
.grid li:nth-child(10n+8),
.grid li:nth-child(10n+9),
.grid li:nth-child(10n+10) {
margin-top: 0%;
margin-bottom: 0%;
-o-transform: none;
-moz-transform: none;
-webkit-transform: none;
-ms-transform: none;
transform: none;
}
}
#media only screen and (max-width: 400px) {
.grid li {
display: inline-block;
width: 100%;
height: 35%;
padding-bottom: 10px;
}
.grid li:nth-child(2n+1) {
margin-right: 0%;
}
}
/*hover effects*/
/*!
* Hover.css (http://ianlunn.github.io/Hover/)
* Version: 2.2.0
* Author: Ian Lunn #IanLunn
* Author URL: http://ianlunn.co.uk/
* Github: https://github.com/IanLunn/Hover
* Hover.css Copyright Ian Lunn 2017. Generated with LESS.
*/
/* Sweep To Right */
.hvr-sweep-to-right {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-sweep-to-right:before {
content: "";
position: absolute;
z-index: 5;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #2693ff;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: 0 50%;
transform-origin: 0 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sweep-to-right:hover,
.hvr-sweep-to-right:focus,
.hvr-sweep-to-right:active {
color: white;
}
.hvr-sweep-to-right:hover:before,
.hvr-sweep-to-right:focus:before,
.hvr-sweep-to-right:active:before {
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
/* Sweep To Bottom */
.hvr-sweep-to-bottom {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-sweep-to-bottom:before {
content: "";
position: absolute;
z-index: 5;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #2693ff;
-webkit-transform: scaleY(0);
transform: scaleY(0);
-webkit-transform-origin: 50% 0;
transform-origin: 50% 0;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-sweep-to-bottom:hover,
.hvr-sweep-to-bottom:focus,
.hvr-sweep-to-bottom:active {
color: white;
}
.hvr-sweep-to-bottom:hover:before,
.hvr-sweep-to-bottom:focus:before,
.hvr-sweep-to-bottom:active:before {
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
/* Radial Out */
.hvr-radial-out {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
overflow: hidden;
background: #e1e1e1;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-radial-out:before {
content: "";
position: absolute;
z-index: 5;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #2693ff;
border-radius: 100%;
-webkit-transform: scale(0);
transform: scale(0);
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-radial-out:hover,
.hvr-radial-out:focus,
.hvr-radial-out:active {
color: white;
}
.hvr-radial-out:hover:before,
.hvr-radial-out:focus:before,
.hvr-radial-out:active:before {
-webkit-transform: scale(2);
transform: scale(2);
}
/* Shutter Out Horizontal */
.hvr-shutter-out-horizontal {
display: inline-block;
vertical-align: middle;
-webkit-transform: perspective(1px) translateZ(0);
transform: perspective(1px) translateZ(0);
box-shadow: 0 0 1px rgba(0, 0, 0, 0);
position: relative;
background: #e1e1e1;
-webkit-transition-property: color;
transition-property: color;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
}
.hvr-shutter-out-horizontal:before {
content: "";
position: absolute;
z-index: 5;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: #2693ff;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transform-origin: 50%;
transform-origin: 50%;
-webkit-transition-property: transform;
transition-property: transform;
-webkit-transition-duration: 0.3s;
transition-duration: 0.3s;
-webkit-transition-timing-function: ease-out;
transition-timing-function: ease-out;
}
.hvr-shutter-out-horizontal:hover,
.hvr-shutter-out-horizontal:focus,
.hvr-shutter-out-horizontal:active {
color: white;
}
.hvr-shutter-out-horizontal:hover:before,
.hvr-shutter-out-horizontal:focus:before,
.hvr-shutter-out-horizontal:active:before {
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
<!doctype html>
<html>
<head>
<!--<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/hover.css/2.1.1/css/hover.css">-->
</head>
<body>
<ul class="grid">
<li>
<div class="hexagon img1 hvr-sweep-to-right"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-sweep-to-bottom"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-radial-out"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img1 hvr-shutter-out-horizontal"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-sweep-to-right"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-sweep-to-bottom"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img1 hvr-radial-out"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-shutter-out-horizontal"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-sweep-to-right"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img1 hvr-sweep-to-bottom"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-radial-out"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-shutter-out-horizontal"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img1 hvr-sweep-to-right"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img2 hvr-sweep-to-bottom"><div class="text">Hello World</div></div>
</li>
<li>
<div class="hexagon img3 hvr-radial-out"><div class="text">Hello World</div></div>
</li>
</ul>
</body>
</html>
I've been trying to remove this ugly flicker when hovering over the images. I've tried adding -webkit-backface-visibility: hidden; to the hover element along with the :hover itself but can't seem to shake it. Seems the promblem is only on Chrome and Safari.
website: http://best-law-firm-sites.com/lawpromo12/
.col-sm-4 {
width: 33.3333%;
float: left;
}
.panel-wrap {
height: 100% !important;
}
.panel-wrap .col-sm-4 {
padding: 0;
}
.hovereffect {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
cursor: default;
}
.hovereffect .overlay {
width: 100%;
height: 100%;
position: absolute;
overflow: hidden;
top: 0;
left: 0;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.hovereffect h2,
.hovereffect img {
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.hovereffect img {
display: block;
position: relative;
-webkit-transform: scale(1.001);
-ms-transform: scale(1.001);
-moz-transform: scale(1.001);
-o-transform: scale(1.001);
transform: scale(1.001);
}
.hovereffect:hover img {
-webkit-transform: scale(1.17);
-ms-transform: scale(1.17);
-moz-transform: scale(1.17);
-o-transform: scale(1.17);
transform: scale(1.17);
}
.hovereffect h2 {
bottom: 10%;
color: #fff;
font-size: 30px;
font-weight: 700;
padding: 10px 10px 10px 17px;
position: absolute;
text-align: left;
text-shadow: 2px 3px 6px rgba(0, 0, 0, 1);
text-transform: uppercase;
}
.hovereffect h2::after {
display: block;
content: "";
height: 4px;
width: 75px;
background: #BCA474;
margin: 20px 0 0;
box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.6);
}
.hovereffect a.info {
display: inline-block;
text-decoration: none;
padding: 7px 14px;
text-transform: uppercase;
color: #fff;
margin: 50px 0 0 0;
background-color: transparent;
-webkit-transform: scale(1.5);
-ms-transform: scale(1.5);
transform: scale(1.5);
-webkit-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
font-weight: normal;
height: 100%;
width: 85%;
position: absolute;
top: 0;
left: 0;
padding: 70px;
}
.hovereffect:hover a.info {
-webkit-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
<div class="col-sm-4 panel-1">
<div class="hovereffect">
<img class="img-responsive" src="http://best-law-firm-sites.com/lawpromo12/wp-content/uploads/2016/02/panel1.jpg" alt="">
<div class="overlay">
<h2>Family Law</h2>
<a class="info" href="services/family-law/"></a>
</div>
</div>
</div>
<div class="col-sm-4 panel-2">
<div class="hovereffect">
<img class="img-responsive" src="http://best-law-firm-sites.com/lawpromo12/wp-content/uploads/2016/02/panel.jpg" alt="">
<div class="overlay">
<h2>Estate Planning</h2>
<a class="info" href="services/estate-planning/"></a>
</div>
</div>
</div>
<div class="col-sm-4 panel-2">
<div class="hovereffect">
<img class="img-responsive" src="http://best-law-firm-sites.com/lawpromo12/wp-content/uploads/2016/02/panel.jpg" alt="">
<div class="overlay">
<h2>Wills & Trusts</h2>
<a class="info" href="services/wills-trusts/"></a>
</div>
</div>
</div>
I have encountered similarly strange behavior in the past when using the backface visibility hack to trick the browser into using the 3d pipeline. There are other ways to 'trick' the browser into using the 3d pipeline like:
.class{
transform: translate3d(0,0,1);
}
You can resolve this problem by increasing the transform scale property to 1.001:
.hovereffect img{transform: scale(1.001);}
I think it may have something to do with a pseudo element, but I'm not sure. I am having difficulties with the effect of a transform transition using css3. In Firefox v24, the effect works as I want it to - see the CodePen here http://codepen.io/patrickwc/pen/aKEec but in Chrome and IE, the border effect of the links animate and then suddenly switch back into position. It is difficult to describe so the best way is to look at the effect in Firefox then in Chrome or IE.
body {
background: #000;
color: #fff;
}
p {
text-align: center;
}
nav.footer-social-links a {
position: relative;
margin: 0 10px;
text-transform: uppercase;
letter-spacing: 1px;
padding: 1px 12px 0 8px;
height: 32px;
line-height: 30px;
outline: none;
font-size: 0.8em;
text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}
nav.footer-social-links a:hover,
nav.footer-social-links a:focus {
outline: none;
}
.footer-social-links a::before,
.footer-social-links a::after {
position: absolute;
width: 30px;
height: 2px;
background: #fff;
content: '';
opacity: 0.2;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
-webkit-transition: all 0.3s;
transition: all 0.3s;
pointer-events: none;
}
.footer-social-links a::before {
top: 0;
left: 0;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
transform: rotate(90deg);
-webkit-transform-origin: 0 0;
-moz-transform-origin: 0 0;
transform-origin: 0 0;
}
.footer-social-links a::after {
right: 0;
bottom: 0;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
transform: rotate(90deg);
-webkit-transform-origin: 100% 0;
-moz-transform-origin: 100% 0;
transform-origin: 100% 0;
}
.footer-social-links a:hover::before,
.footer-social-links a:hover::after,
.footer-social-links a:focus::before,
.footer-social-links a:focus::after {
opacity: 1;
}
.footer-social-links {
margin: 0;
text-align: center;
}
.footer-social-links a {
color: white;
-webkit-transition: all 0.3s;
-moz-transition: all 0.3s;
-o-transition: all 0.3s;
transition: all 0.3s;
display: inline-block;
text-decoration: none;
}
.footer-social-links a:hover::before,
.footer-social-links a:focus::before {
width: 80%;
left: 10%;
-webkit-transform: rotate(0deg) translateX(50%);
-moz-transform: rotate(0deg) translateX(50%);
transform: rotate(0deg) translateX(50%);
}
.footer-social-links a:hover::after,
.footer-social-links a:focus::after {
width: 80%;
right: 5%;
-webkit-transform: rotate(0deg) translateX(50%);
-moz-transform: rotate(0deg) translateX(50%);
transform: rotate(0deg) translateX(50%);
}
<br/>
<nav class="footer-social-links">
<a href="google" target="_blank">
<i class="shc icon-e-gplus"></i>Gplus </a>
<a href="facebook" target="_blank">
<i class="shc icon-e-facebook"></i>Facebook </a>
<a href="twitter" target="_blank">
<i class="shc icon-e-twitter"></i>Twitter </a>
<a href="linkedin" target="_blank">
<i class="shc icon-e-linkedin"></i>Linkedin </a>
<a href="skype" target="_blank">
<i class="shc icon-e-skype"></i>Skype </a>
<a href="http://last.fm/user/zerodegreeburn" target="_blank">
<i class="shc icon-e-lastfm"></i>Lastfm </a>
</nav>
<p>Fixed with help from css-tricks forum and stackoverflow here
</p>
I have a feeling messing with transform-origin might fix it, but I've been unable to get that to work. Any help or explanation as to the difference would be greatly appreciated.
I am not sure about why Chrome has problems with your code, but you can simplify it and then it will work ok in all the browsers.
You should change your CSS to
.footer-social-links a:hover::before,
.footer-social-links a:focus::before {
width: 80%;
left: 10%;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
transform: rotate(0deg);
}
.footer-social-links a:hover::after,
.footer-social-links a:focus::after {
width: 80%;
right: 10%;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
transform: rotate(0deg);
}
It is useless to do a translate in X and at the same time modify your left value; better concentrate the changes in a single value (left) and eliminate the translateX