CSS3 transform difference in Firefox and Chrome and IE - css

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

Related

My off-canvas toggle menu isn't directing to my #section

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

Using 2 ::before and 2 ::after pseudo element for 1 class

Hi can i know how can use 2 pseudo element for 1 class or 2 class. I tried both ways was still being overridden. Your help and advice much appreciated.
I tried 2 ways. First as below
<div class="custom_class">
<p>Custome Text</p>
</div>
.custom_class::before
{
}
.custom_class::after
{
}
.custom_class::before
{
}
.custom_class:::after
{
}
Second wat as below
<div class="custom_class1 custom_class2">
<p>Custome Text</p>
</div>
.custom_class1::before
{
}
.custom_class1::after
{
}
.custom_class2::before
{
}
.custom_class2:::after
{
}
But both not working. Can please advice on this
-------Edited------------------
This is my html code
<div class="classOne transx transy">
<div class="flex-row">
Custome Text
</div>
</div>
Added my code css code
.classOne {
position: absolute;
left: 50%;
width: 20%;
height: 55px;
border-radius: 0px;
box-shadow: 4px 8px 16px 0 rgba(0, 0, 0, 0.1);
outline: 3px solid gold;
overflow: hidden;
background: #ffbb00;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: antialiased;
-webkit-text-shadow: rgba(0,0,0,.01) 0 0 1px;
text-shadow: rgba(0,0,0,.01) 0 0 1px;
margin-left:30.6%;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
a.classOneBtn
{
color: white;
font-family: 'Chivo Black', sans-serif;
font-size: 18px;
font-weight: 500;
}
.transy::before
{
height: 100%;
width: 5px;
background: white;
content: "";
position: absolute;
left: 0;
top: 0;
-moz-transform: scaleY(0);
-ms-transform: scaleY(0);
-webkit-transform: scaleY(0);
transform: scaleY(0);
-moz-transition: 0.3s;
-o-transition: 0.3s;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.transy::after
{
height: 100%;
width: 5px;
background: white;
content: "";
position: absolute;
right: 0;
top: 0;
-moz-transform: scaleY(0);
-ms-transform: scaleY(0);
-webkit-transform: scaleY(0);
transform: scaleY(0);
-moz-transition: 0.3s;
-o-transition: 0.3s;
-webkit-transition: 0.3s;
}
.transx::before
{
height: 5px;
width: 100%;
background: white;
content: "";
position: absolute;
left: 0;
top: 0;
-moz-transform: scaleX(0);
-ms-transform: scaleX(0);
-webkit-transform: scaleX(0);
transform: scaleX(0);
-moz-transition: 0.3s;
-o-transition: 0.3s;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.transx::after
{
height: 5px;
width: 100%;
background: white;
content: "";
position: absolute;
left: 0px;
bottom: 0;
-moz-transform: scaleX(0);
-ms-transform: scaleX(0);
-webkit-transform: scaleX(0);
transform: scaleX(0);
-moz-transition: 0.3s;
-o-transition: 0.3s;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.transx:hover::before, .transx:hover::after
{
-moz-transform: scaleX(1);
-ms-transform: scaleX(1);
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.transy:hover::before, .transy:hover::after
{
-moz-transform: scaleY(1);
-ms-transform: scaleY(1);
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
This was for the animation part whereby when hover will show a line of box This the code which i was performing.
If you would like see output. you need comment the transx
In the same element you can not.
It is not the same item but you can get something similar.
.transx{
position:absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.classOne {
text-align: center;
position: absolute;
left: 50%;
width: 20%;
height: 55px;
border-radius: 0px;
box-shadow: 4px 8px 16px 0 rgba(0, 0, 0, 0.1);
outline: 3px solid gold;
overflow: hidden;
background: #ffbb00;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: antialiased;
-webkit-text-shadow: rgba(0,0,0,.01) 0 0 1px;
text-shadow: rgba(0,0,0,.01) 0 0 1px;
margin-left:30.6%;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
a.classOneBtn
{
color: white;
font-family: 'Chivo Black', sans-serif;
font-size: 18px;
font-weight: 500;
}
.transy::before
{
height: 100%;
width: 5px;
background: white;
content: "";
position: absolute;
left: 0;
top: 0;
-moz-transform: scaleY(0);
-ms-transform: scaleY(0);
-webkit-transform: scaleY(0);
transform: scaleY(0);
-moz-transition: 0.3s;
-o-transition: 0.3s;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.transy::after
{
height: 100%;
width: 5px;
background: white;
content: "";
position: absolute;
right: 0;
top: 0;
-moz-transform: scaleY(0);
-ms-transform: scaleY(0);
-webkit-transform: scaleY(0);
transform: scaleY(0);
-moz-transition: 0.3s;
-o-transition: 0.3s;
-webkit-transition: 0.3s;
}
.transx::before
{
height: 5px;
width: 100%;
background: white;
content: "";
position: absolute;
left: 0;
top: 0;
-moz-transform: scaleX(0);
-ms-transform: scaleX(0);
-webkit-transform: scaleX(0);
transform: scaleX(0);
-moz-transition: 0.3s;
-o-transition: 0.3s;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.transx::after
{
height: 5px;
width: 100%;
background: white;
content: "";
position: absolute;
left: 0px;
bottom: 0;
-moz-transform: scaleX(0);
-ms-transform: scaleX(0);
-webkit-transform: scaleX(0);
transform: scaleX(0);
-moz-transition: 0.3s;
-o-transition: 0.3s;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.transx:hover::before, .transx:hover::after
{
-moz-transform: scaleX(1);
-ms-transform: scaleX(1);
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
.transy:hover::before, .transy:hover::after
{
-moz-transform: scaleY(1);
-ms-transform: scaleY(1);
-webkit-transform: scaleY(1);
transform: scaleY(1);
}
<div class="classOne transy">
<div class="transx"></div>
<div class="flex-row">
Custome Text
</div>
</div>
You can only have one ::before and one ::after pseudo-element per element, but with some CSS magic you can make it look like the pseudo-elements of a child element belongs to its parent:
*::before,
*::after {
display: block;
}
.custom_class1::before {
content: "outer before"
}
.custom_class1::after {
content: "outer after"
}
.custom_class1 p::before {
content: "inner before";
position: absolute;
top: -18px;
}
.custom_class1 p::after {
content: "inner after";
position: absolute;
bottom: -18px;
}
.custom_class1 p {
position: relative;
background-color: lightblue;
}
.custom_class1 {
background-color: pink;
display: inline-block;
}
<div class="custom_class1 custom_class2">
<p>Custome Text</p>
</div>
You can achieve what you want without any pseudo element:
.box {
display:inline-block;
border:1px solid #000;
padding:4px;
background:
linear-gradient(#fff,#fff) left,
linear-gradient(#fff,#fff) bottom,
linear-gradient(#fff,#fff) right,
linear-gradient(#fff,#fff) top;
background-repeat:no-repeat;
background-origin:content-box;
background-size:5px 0%,0% 5px;
background-color:orange;
transition:0.5s;
}
.box:hover {
background-size:5px 100%,100% 5px;
}
.box a {
display:inline-block;
padding:20px 50px;
}
<div class="box">
text
</div>

hamburger menu on close animation

I'm creating a hamburger menu but I have some problems with an animation.
I created 2 divs, 1 for the 3 basic horizontal lines, and one for the " X ". I know how to hide and show them with jQuery ( like, one you click on the 3 lines, the 3 lines hides, and the " X " shows ) but I want to create an animation on that " X " like it's drawn both " \ " and " / " simultaneously. Like it stars from the top corner and it ends and the bottom. I don't really know how to explain this and my english is bad. here's what I did so far
<div class="x">
<div></div>
<div></div>
</div>
and the CSS
.x {
position: fixed;
top:47%;
left: 5%; }
.x div {
width: 40px;
height: 2px;
background-color: #000000; }
.x div:nth-child(1) {
transform: rotate(45deg); }
.x div:nth-child(2) {
transform: rotate(-45deg); }
I tried to create an animation on each line which starts from witdh:0 ( 0% ) and witdh:40px ( 100% ) but because I used the transform property it doesn't animate the way I want, it changes the positions and stuff.
Ty and I'm really sorry, but I don't know how to explain this.
I think you're looking for something like this:
document.addEventListener('DOMContentLoaded', function(){
var menus = document.querySelectorAll('.menu');
var onClick = function(){
this.classList.toggle('open');
}
menus.forEach(function(menu, index){
menu.addEventListener('click', onClick);
});
});
body {
margin: 20px;
}
.menu {
cursor: pointer;
height: 24px;
list-style: none;
margin: 0;
padding: 0;
width: 30px;
position: relative;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .3s ease-in-out;
-moz-transition: .3s ease-in-out;
-o-transition: .3s ease-in-out;
transition: .3s ease-in-out;
}
.menu li {
background-color: #111;
border-radius: 4px;
display: block;
height: 4px;
left: 0;
margin: 0;
opacity: 1;
padding: 0;
position: absolute;
width: 100%;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
-webkit-transition: .15s ease-in-out;
-moz-transition: .15s ease-in-out;
-o-transition: .15s ease-in-out;
transition: .15s ease-in-out;
}
.menu li:nth-child(1) {
top: 0;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
.menu li:nth-child(2) {
top: 9px;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
.menu li:nth-child(3) {
top: 18px;
-webkit-transform-origin: left center;
-moz-transform-origin: left center;
-o-transform-origin: left center;
transform-origin: left center;
}
.menu.open li:nth-child(1) {
left: 4px;
top: -1px;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.menu.open li:nth-child(2) {
opacity: 0;
width: 0;
}
.menu.open li:nth-child(3) {
left: 4px;
top: 20px;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
}
<ul class="menu">
<li></li>
<li></li>
<li></li>
</ul>
with jQuery
$(document).ready(function(){
$('.menu').click(function(){
$(this).toggleClass('open');
});
});
Bogdan. I made an example for you, if I correctly understood your question.
HTML:
<div id="hamburger" class="hamburger hamburger_active">
<div class="hamburger__line"></div>
<div class="hamburger__line"></div>
</div>
CSS:
.hamburger {
width: 40px;
height: 40px;
position: fixed;
top:50%;
left: 50%;
border: 1px solid red;
}
.hamburger.hamburger_active .hamburger__line {
width: 100%;
}
.hamburger__line {
width: 0;
height: 2px;
position: absolute;
transform-origin: 20px 0;
top: 50%;
left: 0;
background-color: #000000;
transition: width .3s ease;
}
.hamburger__line:nth-child(1) {
transform: rotate(45deg);
}
.hamburger__line:nth-child(2) {
transform: rotate(135deg);
}
jQuery:
var $menu = $("#hamburger");
$menu.click(function() {
$(this).toggleClass('hamburger_active');
});

Add CSS from codemyui to Button on wordpress site

I would like to add to add this css example to my button on my website
https://codemyui.com/ghost-button-glint-effect-3d-button/
I already tried pasting the css code in the wordpress customizer add css input...
I adjusted the class to my button....
.btn--primary
but it doesn't work
hope anybody can help me.
Thanks in advance!
#-webkit-keyframes sheen {
0% {
-webkit-transform: skewY(-45deg) translateX(0);
transform: skewY(-45deg) translateX(0);
}
100% {
-webkit-transform: skewY(-45deg) translateX(12.5em);
transform: skewY(-45deg) translateX(12.5em);
}
}
#keyframes sheen {
0% {
-webkit-transform: skewY(-45deg) translateX(0);
transform: skewY(-45deg) translateX(0);
}
100% {
-webkit-transform: skewY(-45deg) translateX(12.5em);
transform: skewY(-45deg) translateX(12.5em);
}
}
.wrapper {
display: block;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.button {
padding: 0.75em 2em;
text-align: center;
text-decoration: none;
color: #2194E0;
border: 2px solid #2194E0;
font-size: 24px;
display: inline-block;
border-radius: 0.3em;
-webkit-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
position: relative;
overflow: hidden;
}
.button:before {
content: "";
background-color: rgba(255, 255, 255, 0.5);
height: 100%;
width: 3em;
display: block;
position: absolute;
top: 0;
left: -4.5em;
-webkit-transform: skewX(-45deg) translateX(0);
transform: skewX(-45deg) translateX(0);
-webkit-transition: none;
transition: none;
}
.button:hover {
background-color: #2194E0;
color: #fff;
border-bottom: 4px solid #1977b5;
}
.button:hover:before {
-webkit-transform: skewX(-45deg) translateX(13.5em);
transform: skewX(-45deg) translateX(13.5em);
-webkit-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
<div class="wrapper">
Shiney!
</div>
I managed to get this integrated in my WordPress installation. Try using the !important tag incase there are some predefined classes in your template.

CSS Sidebar overlay my content

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>

Resources