Related
I found and I integrated this code in my Wordpress.
I would ask you, do you know how to make links in the CSS and where?
I made the links with <a href=""> in the HTML but then I have links only on the text and not on the whole button.
#import url("https://fonts.googleapis.com/css?family=Lato");
*,
*:before,
*:after { /* Slow, yes I know :) */
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html,
body {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
font-family: Lato, Sans-serif;
font-size: 12px;
background: #353138;
background: -moz-radial-gradient(center, ellipse cover, #353138 0%, #1a181c 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #353138), color-stop(100%, #1a181c));
background: -webkit-radial-gradient(center, ellipse cover, #353138 0%,#1a181c 100%);
background: -o-radial-gradient(center, ellipse cover, #353138 0%,#1a181c 100%);
background: -ms-radial-gradient(center, ellipse cover, #353138 0%,#1a181c 100%);
background: radial-gradient(ellipse at center, #353138 0%,#1a181c 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#353138', endColorstr='#1a181c', GradientType=1);
}
.container {
margin: 0;
width: 100%;
height: 100%;
padding: 20px;
-webkit-perspective: 1500px;
-moz-perspective: 1500px;
-ms-perspective: 1500px;
perspective: 1500px;
position: relative;
}
.toggle {
color: #fff;
display: inline-block;
line-height: 16px;
font-size: 20px;
float: left;
}
.menu {
margin: 100px auto;
position: relative;
background: #62278d;
background: -moz-linear-gradient(top, #62278d 0%, #2cc09b 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#62278d), color-stop(100%,#2cc09b));
background: -webkit-linear-gradient(top, #62278d 0%,#2cc09b 100%);
background: -o-linear-gradient(top, #62278d 0%,#2cc09b 100%);
background: -ms-linear-gradient(top, #62278d 0%,#2cc09b 100%);
background: linear-gradient(to bottom, #62278d 0%,#2cc09b 100%);
width: 300px;
border-width: 20px 0;
border-style: solid;
border-color: #fff;
color: #fff;
height: 540px;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
-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;
-webkit-box-shadow: 0 0 50px 0 #444;
-moz-box-shadow: 0 0 50px 0 #444;
box-shadow: 0 0 50px 0 #444;
}
input.toggle:checked ~ .menu {
-webkit-transform: translateY(-200px) translateZ(-150px) rotateX(45deg) rotateZ(45deg);
-moz-transform: translateY(-150px) rotateX(45deg) rotateZ(45deg);
-ms-transform: translateY(-150px) rotateX(45deg) rotateZ(45deg);
-o-transform: translateY(-150px) rotateX(45deg) rotateZ(45deg);
transform: translateY(-150px) rotateX(45deg) rotateZ(45deg);
}
.menu:before {
content: '';
position: absolute;
height: 30px;
width: 300px;
top: 520px;
left: 0px;
-webkit-transform: rotateX(90deg) translateY(-15px) translateZ(15px);
-moz-transform: rotateX(90deg) translateY(-15px) translateZ(15px);
-ms-transform: rotateX(90deg) translateY(-15px) translateZ(15px);
-o-transform: rotateX(90deg) translateY(-15px) translateZ(15px);
transform: rotateX(90deg) translateY(-15px) translateZ(15px);
background: #fff;
pointer-events: none;
}
.menu:after {
content: '';
position: absolute;
height: 540px;
width: 30px;
top: -20px;
right: -30px;
-webkit-transform: rotateY(90deg) translateZ(-15px) translateX(15px);
-moz-transform: rotateY(90deg) translateZ(-15px) translateX(15px);
-ms-transform: rotateY(90deg) translateZ(-15px) translateX(15px);
-o-transform: rotateY(90deg) translateZ(-15px) translateX(15px);
transform: rotateY(90deg) translateZ(-15px) translateX(15px);
border-width: 20px 0;
border-style: solid;
border-color: #fff;
background: #62278d;
background: -moz-linear-gradient(top, #62278d 0%, #2cc09b 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#62278d), color-stop(100%,#2cc09b));
background: -webkit-linear-gradient(top, #62278d 0%,#2cc09b 100%);
background: -o-linear-gradient(top, #62278d 0%,#2cc09b 100%);
background: -ms-linear-gradient(top, #62278d 0%,#2cc09b 100%);
background: linear-gradient(to bottom, #62278d 0%,#2cc09b 100%);
pointer-events: none;
}
.menu .top {
padding: 15px 15px 15px 20px;
width: 100%;
}
.menu .top .search {
position: relative;
display: inline-block;
}
.menu .top .search input {
background-color: transparent;
-webkit-transition: all 100ms ease-in-out;
-moz-transition: all 100ms ease-in-out;
-ms-transition: all 100ms ease-in-out;
-o-transition: all 100ms ease-in-out;
transition: all 100ms ease-in-out;
color: transparent;
border: 1px solid #fff;
border-radius: 20px;
padding: 10px 30px 10px 15px;
outline: 0 none;
width: 60px;
height: 40px;
position: relative;
-webkit-transform: translateZ(1px);
-moz-transform: translateZ(1px);
-ms-transform: translateZ(1px);
-o-transform: translateZ(1px);
transform: translateZ(1px);
z-index: 2;
}
.menu .top .search input:focus {
width: 200px;
color: #fff;
}
.menu .top .search:after {
content: '\f002';
font-family: 'FontAwesome';
font-size: 16px;
position: absolute;
color: #fff;
top: 11px;
right: 18px;
width: 20px;
height: 20px;
pointer-events: none;
-webkit-transform: translateZ(1px);
-moz-transform: translateZ(1px);
-ms-transform: translateZ(1px);
-o-transform: translateZ(1px);
transform: translateZ(1px);
z-index: 1;
}
.menu .top .exit {
position: relative;
display: inline-block;
width: 40px;
height: 40px;
outline: 0 none;
float: right;
cursor: pointer;
-webkit-transform: translateZ(1px);
-moz-transform: translateZ(1px);
-ms-transform: translateZ(1px);
-o-transform: translateZ(1px);
transform: translateZ(1px);
z-index: 2;
}
.menu .top .exit:focus,
.menu .top .exit:active {
border: 1px solid #fff;
border-radius: 20px;
}
.menu .top .exit:before {
content: '';
pointer-events: none;
position: absolute;
display: block;
width: 30px;
height: 30px;
top: 14px;
left: -6px;
border-width: 0 2px 0 0;
border-style: solid;
border-color: #fff;
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
-o-transform: rotate(-45deg);
transform: rotate(-45deg);
z-index: 1;
}
.menu .top .exit:after {
content: '';
pointer-events: none;
position: absolute;
display: block;
width: 30px;
height: 30px;
top: -6px;
left: -6px;
border-width: 0 2px 0 0;
border-style: solid;
border-color: #fff;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.menu .middle {
position: relative;
min-height: 40px;
list-style: none;
padding: 0;
margin: 0;
text-transform: uppercase;
font-weight: bold;
font-size: 15px;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
}
.menu .middle li {
margin: 0;
padding: 15px 0 15px 40px;
outline: 0 none;
position: relative;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-transform: translateZ(1px);
-moz-transform: translateZ(1px);
-ms-transform: translateZ(1px);
-o-transform: translateZ(1px);
transform: translateZ(1px);
z-index: 1;
}
.menu .middle li:hover {
-webkit-box-shadow: inset 0 0 80px 0 rgba(255, 255, 255, 0.3);
-moz-box-shadow: inset 0 0 80px 0 rgba(255, 255, 255, 0.3);
box-shadow: inset 0 0 80px 0 rgba(255, 255, 255, 0.3);
cursor: pointer;
}
.menu .middle li:hover:before,
.menu .middle li:focus:before {
content: '\f0da';
font-family: 'FontAwesome';
font-size: 16px;
position: absolute;
top: 15px;
left: 20px;
}
.menu .middle li:focus,
.menu .middle li:focus:after {
color: #3EAC9E;
background-color: #62278d;
}
.menu .middle li .fa {
padding-right: 15px;
}
.menu .middle li:focus:after,
.menu .middle li:hover:after {
content: '';
position: absolute;
height: 48px;
width: 30px;
top: 0px;
right: -30px;
-webkit-transform: rotateY(90deg) translateZ(-14px) translateX(15px);
-moz-transform: rotateY(90deg) translateZ(-14px) translateX(15px);
-ms-transform: rotateY(90deg) translateZ(-14px) translateX(15px);
-o-transform: rotateY(90deg) translateZ(-14px) translateX(15px);
transform: rotateY(90deg) translateZ(-14px) translateX(15px);
pointer-events: none;
}
.menu .middle li:hover:after {
-webkit-box-shadow: inset 0 0 80px 0 rgba(255, 255, 255, 0.3);
-moz-box-shadow: inset 0 0 80px 0 rgba(255, 255, 255, 0.3);
box-shadow: inset 0 0 80px 0 rgba(255, 255, 255, 0.3);
}
.menu .bottom {
height: 40px;
}
.menu-back {
position: absolute;
background: transparent;
top: -20px;
left: 0;
width: 300px;
height: 540px;
-webkit-transform: translateZ(-29px);
-moz-transform: translateZ(-29px);
-ms-transform: translateZ(-29px);
-o-transform: translateZ(-29px);
transform: translateZ(-29px);
-webkit-box-shadow: 100px 100px 50px -30px #111;
-moz-box-shadow: 100px 100px 50px -30px #111;
box-shadow: 100px 100px 50px -30px #111;
z-index: 0;
}
.glass-reflection {
position: absolute;
-webkit-transition: box-shadow 1s;
-moz-transition: box-shadow 1s;
-ms-transition: box-shadow 1s;
-o-transition: box-shadow 1s;
transition: box-shadow 1s;
-webkit-transform: rotateZ(-1deg) translateZ(1px) skewY(60deg);
-moz-transform: rotateZ(-1deg) translateZ(1px) skewY(60deg);
-ms-transform: rotateZ(-1deg) translateZ(1px) skewY(60deg);
-o-transform: rotateZ(-1deg) translateZ(1px) skewY(60deg);
transform: rotateZ(-1deg) translateZ(1px) skewY(60deg);
-webkit-box-shadow: inset 0px -40px 0px -50px rgba(255, 255, 255, 0.0);
-moz-box-shadow: inset 0px -40px 0px -50px rgba(255, 255, 255, 0.0);
box-shadow: inset 0px -40px 0px -50px rgba(255, 255, 255, 0.0);
border-radius: 200px 0 20px 0 ;
top: 85px;
left: 95px;
width: 200px;
height: 100px;
background-color: transparent;
}
input.toggle:checked ~ .menu .glass-reflection {
-webkit-box-shadow: inset 0px -40px 150px -50px rgba(255, 255, 255, 0.15);
-moz-box-shadow: inset 0px -40px 150px -50px rgba(255, 255, 255, 0.15);
box-shadow: inset 0px -40px 150px -50px rgba(255, 255, 255, 0.15);
}
<!--
Inspired by this dribble by The Purple Bunny:
https://dribbble.com/shots/1677163-Menu
-->
<div class="container">
<input type="checkbox" class="toggle" id="toggle" checked="checked" /><label class="toggle" for="toggle"> Toggle tilt</label>
<div class="menu">
<div class="top">
<span class="search">
<input type="text">
</span>
<a class="exit" href="#" tabindex="0"></a>
</div>
<ul class="middle">
<li tabindex="0"><i class="fa fa-calendar"></i>Calendar</li>
<li tabindex="0"><i class="fa fa-camera"></i>Photos</li>
<li tabindex="0"><i class="fa fa-check-square-o"></i>Tasks</li>
<li tabindex="0"><i class="fa fa-map-marker"></i>Places</li>
<li tabindex="0"><i class="fa fa-codepen"></i>Codepen</li>
<li tabindex="0"><i class="fa fa-dribbble"></i>Dribbble</li>
<li tabindex="0"><i class="fa fa-user"></i>User account</li>
<li tabindex="0"><i class="fa fa-cogs"></i>Settings</li>
</ul>
<div class="bottom"></div>
<div class="menu-back"></div>
<div class="glass-reflection"></div>
</div>
</div>
Have you tried styling your link to look like a button? Like this?
a{border:solid 1px black; padding:20px;background-color:yellow; text-decoration:none;font-size:1.5em; border-radius:50%;}
I made padding big so you can put mouse all around the text inside of the button and see that it still works.
https://codepen.io/susanwinters/pen/wvWjBYW
Wrap whole button with tag, not only text.
I am making this project, but when I resize the window the css goes all over. I do not know how to make it responsive while maintaining the look I want
I have tried switching the units to rem but it still does not work
Here is the CSS:
color: whitesmoke;
}
p{
text-align: center;
font-size:15px;
font-family: 'Source Sans Pro', sans-serif;
}
#space_background{
position: fixed;
right: 0;
bottom: 0;
min-width: 100%;
z-index:-1;
min-height: 100%
}
h1{
position: relative;
z-index:1;
text-align: center;
font-size: 3vw;
font-family: 'Source Sans Pro', sans-serif;
}
#planet{
width: 400px;
height: 400px;
z-index: 1;
display: block;
margin: 0 auto;
vertical-align: middle;
}
#send{
display:block;
margin-left: 45vw;
margin-bottom: 2rem;
margin-top: 1rem;
text-align: center;
/* position: relative; */
padding: 1vw 1.3vw;
top: -30px;
max-width: 100%;
font-size: 15px;
font-family: 'Source Sans Pro', sans-serif;
border-radius: 2px;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
background: rgba(64, 240, 10, 0.795);
color: #fff;
box-shadow: 0px 0px 0px rgba(255, 255, 255, 0.1);
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
#send:hover{
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
#divSend{
text-align: center;
}
#next{
display:block;
margin-left: 46.25vw;
margin-top: 5rem;
margin-bottom: 5px;
text-align: center;
position: relative;
padding: 0.5vw 0.8vw;
top: -30px;
max-width: 100%;
font-size: 15px;
font-family: 'Source Sans Pro', sans-serif;
border-radius: 2px;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
background: rgba(102, 102, 102, 0.795);
color: #fff;
box-shadow: 0px 0px 0px rgba(255, 255, 255, 0.1);
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
#next:hover{
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
#nextDiv{
text-align: center;
}
#atmo{
display:block;
float: left;
margin-left: 9.5vw;
margin-right: 1vw;
margin-bottom: 20px;
text-align: center;
position: relative;
padding: 0.5vw 0.8vw;
top: -30px;
max-width: 100%;
font-size: 15px;
font-family: 'Source Sans Pro', sans-serif;
border-radius: 2px;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
background: rgba(102, 102, 102, 0.795);
color: #fff;
box-shadow: 0px 0px 0px rgba(255, 255, 255, 0.1);
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
#atmo:hover{
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
#rot{
float: right;
margin-right: 1vw;
float: left;
display:block;
margin-bottom: 20px;
text-align: center;
position: relative;
padding: 0.5vw 0.8vw;
top: -30px;
max-width: 100%;
font-size: 15px;
font-family: 'Source Sans Pro', sans-serif;
border-radius: 2px;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
background: rgba(102, 102, 102, 0.795);
color: #fff;
box-shadow: 0px 0px 0px rgba(255, 255, 255, 0.1);
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
#rot:hover{
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
#core{
display:block;
float: left;
margin-right: 31vw;
float: left;
margin-bottom: 20px;
text-align: center;
position: relative;
padding: 0.5vw 0.8vw;
top: -30px;
max-width: 100%;
font-size: 15px;
font-family: 'Source Sans Pro', sans-serif;
border-radius: 2px;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
background: rgba(102, 102, 102, 0.795);
color: #fff;
box-shadow: 0px 0px 0px rgba(255, 255, 255, 0.1);
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
#core:hover{
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
#goldi{
display:block;
float: right;
float: left;
margin-right: 1rem;
margin-bottom: 20px;
text-align: center;
position: relative;
padding: 0.5vw 0.8vw;
top: -30px;
max-width: 100%;
font-size: 15px;
font-family: 'Source Sans Pro', sans-serif;
border-radius: 2px;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
background: rgba(102, 102, 102, 0.795);
color: #fff;
box-shadow: 0px 0px 0px rgba(255, 255, 255, 0.1);
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
#goldi:hover{
-webkit-transform: scale(1.1);
transform: scale(1.1);+
}
#stable{
display:block;
float: left;
float: left;
margin-right: 1rem;
margin-bottom: 20px;
text-align: center;
position: relative;
padding: 0.5vw 0.8vw;
top: -30px;
max-width: 100%;
font-size: 15px;
font-family: 'Source Sans Pro', sans-serif;
border-radius: 2px;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
background: rgba(102, 102, 102, 0.795);
color: #fff;
box-shadow: 0px 0px 0px rgba(255, 255, 255, 0.1);
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
#stable:hover{
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
#water{
display:block;
margin-bottom: 20px;
text-align: center;
position: relative;
padding: 0.5vw 0.8vw;
top: -30px;
max-width: 100%;
font-size: 15px;
font-family: 'Source Sans Pro', sans-serif;
border-radius: 2px;
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
background: rgba(102, 102, 102, 0.795);
color: #fff;
box-shadow: 0px 0px 0px rgba(255, 255, 255, 0.1);
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-ms-transition: all 0.2s ease;
transition: all 0.2s ease;
}
#water:hover{
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
#firstThree{
margin-left: 9.5vw;
}
#lastThree{
margin-left: 66vw;
margin-top: -18px
}
HTML:
<html>
<head>
<meta charset="UTF-8">
<title>Vitae Vinctum</title>
<link rel="stylesheet" type="text/css" href="start_style.css">
<link href="https://fonts.googleapis.com/css?family=Abel|Source+Code+Pro&display=swap" rel="stylesheet">
<!-- <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> -->
</head>
<body>
<video playsinline="playsinline" autoplay muted loop id="space_background">
<source src="imgs/Space_Background.mp4" type="video/mp4">
<img src="imgs/background.jpg" title="Your browser does not support video">
</video>
<h1>The Search for Life Begins...</h1>
<div>
<img id="planet" src="imgs/planet.png">
</div>
<div id="nextDiv">
<button id="next">Next Planet</button>
</div>
<div id="divSend">
<button id="send">Send Expedition</button>
</div>
<div>
<button id="atmo">Atmospheric Test</button>
<button id="rot">Send Expedition</button>
</div>
<div>
<button id="core">Send Expedition</button>
<button id="goldi">Send Expedition</button>
</div>
<div>
<button id="stable">Send Expedition</button>
<button id="water">Send Expedition</button>
</div>
<div id="testResponse">
<p></p>
<p id="atmoText">test</p>
<p>test</p>
<p>test</p>
<p>test</p>
<p>test</p>
</div>
<script src="index.js"></script>
</body>
</html>
It works at full resolution but as soon as the window resizes, it goes wack
You can use both width and max-width properties for one css object:
#planet {
width: 400px;
height: 400px;
max-width: 100%;
z-index: 1;
display: block;
margin: 0 auto;
vertical-align: middle;
}
To make your objects responsive, you should use media queries.
#media screen and (max-width: 400px) {
#planet {width: 100%}
}
#media screen and (min-width: 401px) and (max-width: 700px) {
#planet {width: 75%;}
}
#planet {width: 50%;}
I have a tooltip box and it is working fine. Now I want to add some fade in fade out once the tool-tip box pops in and out.
<a class="tooltip" title="This is some information for our tooltip." href="#"><img id="graph_one" alt="" src="https://www.onlandscape.co.uk/wp-content/uploads/2013/09/Doug-Chinnery-ICM-Images-4-45x45.jpg" class="graph one"> </a>
Demo : http://jsfiddle.net/squidraj/FHUbA/
How about this?
http://jsfiddle.net/FHUbA/14/
.tooltip:after{
opacity: 0;
-webkit-transition: opacity .25s ease-in-out;
-moz-transition: opacity .25s ease-in-out;
transition: opacity .25s ease-in-out;
background: #333;
background: rgba(0, 0, 0, .8);
border-radius: 5px;
bottom: 26px;
color: #fff;
content: attr(title);
left: 20%;
padding: 5px 15px;
position: absolute;
z-index: 98;
width: 220px;
}
.tooltip:hover:after {
opacity:1;
}
What about this one:
http://jsfiddle.net/Roobyx/FHUbA/45/
(you can fix the styles afterwards)
HTML:
<a class="has-tooltip" href="#">
<span class="tooltip">This is some information for our tooltip.</span>
<img id="graph_one" class="graph one" src="https://www.onlandscape.co.uk/wp-content/uploads/2013/09/Doug-Chinnery-ICM-Images-4-45x45.jpg" />
</a>
CSS:
a[title].tooltip {
width:45px;
height:90px;
}
.tooltip {
display: inline-block;
position: relative;
}
.has-tooltip {
color: #555;
font-size: 16px;
display: block;
margin: 150px 75px 10px 75px;
padding: 5px 5px;
position: relative;
text-align: center;
width: 200px;
-webkit-transform: translateZ(0); /* webkit flicker fix */
-webkit-font-smoothing: antialiased; /* webkit text rendering fix */
}
.has-tooltip .tooltip {
background: #000;
bottom: 100%;
color: #fff;
display: block;
left: -10px;
margin-bottom: 15px;
border-radius: 5px;
opacity: 0;
padding: 20px;
position: absolute;
visibility: hidden;
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);
}
.has-tooltip .tooltip:before {
bottom: -20px;
content: " ";
display: block;
height: 20px;
left: 0;
position: absolute;
width: 100%;
}
.has-tooltip .tooltip:after {
border-left: solid transparent 10px;
border-right: solid transparent 10px;
border-top: solid #000 10px;
bottom: -10px;
content: " ";
height: 0;
left: 50%;
margin-left: -13px;
position: absolute;
width: 0;
}
.has-tooltip:hover .tooltip {
opacity: 1;
visibility: visible;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-ms-transform: translateY(0px);
-o-transform: translateY(0px);
transform: translateY(0px);
}
I have an icon: when I click on it, an other div, which was hidden, appears just upside. But only when we hover the icon. It works perfectly on FF and Chrome, but on IE10, when you hover the div hidden, it makes it appear...
Here is the html:
<div class="enveloppe_abo" id="enveloppeabo_92">
<li class="abo">
<img src="/images/avatars/femme.gif" class="avatar_40">
</li>
<div class="bulle_abo">
<div class="avatar_abo_bulle">
<img src="/images/avatars/femme.gif" width="68" height="68">
</div>
<div class="supprabo" id="supprabo_92" alt="Remove subscription" title="Remove subscription"></div>
<div class="texte_abo_bulle">steph.toto.com
<br>
<br>Blog de blog blalala et oui de deux trois et quatre informations
<br>Encore une info et oui bien s&ucir...</div>
</div>
</div>
And the css:
.avatar_abo_bulle{
float: left;
position: relative;
height: 68px;
width: 68px;
display: block;
overflow: hidden;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
box-shadow: 0px 0px 8px 1px #000;
-webkit-box-shadow: 0px 0px 8px 1px rgba(0,0,0, 1);
-moz-box-shadow: 0px 0px 8px 1px rgba(0,0,0, 1);
}
.texte_abo_bulle{
margin-left: 90px;
-webkit-font-smoothing: antialiased;
font-size: 14px;
}
.enveloppe_abo {
position: relative;
float: left;
display: block;
-webkit-transform: translateZ(0);
-webkit-font-smoothing: antialiased;
z-index:11;
}
.enveloppe_bulaut {
position: relative;
-webkit-transform: translateZ(0);
-webkit-font-smoothing: antialiased;
}
.bulle_abo, .combulle {
border: 1px solid #909090;
bottom: 100%;
color: #fff;
display: block;
left: -114px;
margin-bottom: 15px;
opacity: 0;
padding: 20px;
pointer-events: none;
position: absolute;
min-width: 250px;
-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: 0 0 8px 2px rgba(0, 0, 0, 1);
-moz-box-shadow: 0 0 8px 2px rgba(0, 0, 0, 1);
-ms-box-shadow: 0 0 8px 2px rgba(0, 0, 0, 1);
-o-box-shadow: 0 0 8px 2px rgba(0, 0, 0, 1);
box-shadow: 0 0 8px 2px rgba(0, 0, 0, 1);
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #c9c9c9 2%, #606060 53%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(2%,#c9c9c9), color-stop(53%,#606060)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#c9c9c9 2%,#606060 53%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#c9c9c9 2%,#606060 53%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#c9c9c9 2%,#606060 53%); /* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%,#c9c9c9 2%,#606060 53%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#606060',GradientType=0 ); /* IE6-9 */
}
.bulle_abo{
min-height: 90px;
}
.combulle{
margin-left: -36px;
}
/* This bridges the gap so you can mouse into the tooltip without it disappearing */
.bulle_abo:before, .combulle:before {
bottom: -20px;
content: " ";
display: block;
height: 20px;
left: 0;
position: absolute;
width: 100%;
}
/* CSS Triangles - see Trevor's post */
.bulle_abo:after, .combulle:after {
background: url(/themes/glace_et_ombre/images/flbas.png) no-repeat;
bottom: -20px;
content: " ";
height: 20px;
left: 144px;
margin-left: -13px;
position: absolute;
width: 20px;
}
.enveloppe_abo:hover .bulle_abo, .enveloppe_bulaut:hover .combulle{
min-height: 90px;
opacity: 0.95;
display:block;
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 .enveloppe_abo .bulle_abo, lte8 .enveloppe_bulaut .combulle{
display: none;
}
.lte8 .enveloppe_abo .bulle_abo, lte8 .enveloppe_bulaut .combulle {
display: block;
}
a.lien_bulle:link, a.lien_bulle:active, a.lien_bulle:visited {
color: rgb(0, 78, 194);
text-shadow: 0 1px 3px rgb(255, 255, 255);
font-size: 18px;
-o-transition:.3s;
-ms-transition:.3s;
-moz-transition:.3s;
-webkit-transition:.3s;
transition:.3s;
}
a.lien_bulle:hover {
color: rgb(228, 235, 255);
text-shadow: 0 1px 0 #000;
}
The demo: http://jsfiddle.net/YRwCt/
Any solution for this please? :-(
Change
.enveloppe_abo:hover .bulle_abo, .enveloppe_bulaut:hover .combulle{
To
.abo:hover + .bulle_abo, .enveloppe_bulaut:hover .combulle {
Updated jsFiddle
You were selecting the entire container, not just the image
Re-Edit
You must also add display:none to .bulle_abo to retain the same functionality. Updated jsFiddle
.bulle_abo, .combulle {
// A bunch of lines
display: none;
// A bunch more lines
}
Another Edit
To add the animation back I created a CSS3 animation along with browser prefixes. Updated jsFiddle
To call it
animation: appear .25s linear forwards;
The keyframes for it
#keyframes appear {
0% {opacity:0; transform: translateY(10px);}
100% {opacity:1; transform: translateY(0px);}
}
The Fiddle works. Maybe you have to add the doctype at the beginning of your code:
<!DOCTYPE html>
For the life of me I can't figure out how to correct this. I am trying to replicate the effect from http://css-tricks.com/examples/DifferentTransitionsOnOff/ for my Wordpress image grid (code from here https://gist.github.com/matthiaspabst/1959566). 180x150 is my wp post_thumbnail image size.
Trial and error is not getting me anywhere for the past 2 hours. Here is my amateurish attempt at it http://jsfiddle.net/9F3aF/. Please help.
HTML
<div class="gridcontainer">
<div class="griditemleft">
<div class="postimage">
<img width="180" height="134" src="http://www.football-quebec.com/IMG/cache-180x134/arton1095-180x134.jpg" class="attachment-post-thumbnail wp-post-image" alt="lions" />
</div>
</div>
</div>
CSS
/* Thumbnail Grid */
.gridcontainer {}
.gridcontainer .griditemleft, .gridcontainer .griditemright {float: left; width: 210px; height:164px;}
.griditemleft .postimage img, .griditemright .postimage img {
display: block;
position: relative;
padding: 10px 10px 10px 10px;
border: 5px solid #aefbae;
background-image: -moz-linear-gradient(top, #5be93a, #278312);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #5be93a),color-stop(1, #278312));
-moz-border-radius: 25px;
-webkit-border-radius: 25px;
border-radius: 25px;
-webkit-transform: rotate(720deg) rotateY(0);
-webkit-transition: all 0.5s;
-webkit-transition-timing-function: cubic-bezier(1, 0.8, 0.5, 1);
-webkit-transition-delay: 0.5s;
-moz-transform: rotate(720deg);
-moz-transition: all 0.5s;
-moz-transition-timing-function: cubic-bezier(1, 0.8, 0.5, 1);
-moz-transition-delay: 0.5s;
-o-transform: rotate(720deg);
-o-transition: all 0.5s;
-o-transition-timing-function: cubic-bezier(1, 0.8, 0.5, 1);
-o-transition-delay: 0.5s;
-webkit-box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}
.griditemleft .postimage img:hover, .griditemright .postimage img:hover {
-webkit-transition: padding 0.2s, top 0.2s;
-webkit-transform: rotate(0deg) rotateY(0);
-webkit-transition-delay: 0;
-moz-transition: padding 0.2s, top 0.2s;
-moz-transform: rotate(0deg);
-moz-transition-delay: 0;
-o-transition: padding 0.2s, top 0.2s;
-o-transform: rotate(0deg);
-o-transition-delay: 0;
z-index: 1;
padding: 20px 20px 20px 20px;
margin: -10px 0 0 -10px;
background-image: -moz-linear-gradient(top, #5be93a, #5be93a, #278312);
background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #5be93a),color-stop(0.2, #5be93a),color-stop(1, #278312));
width: 180px; height:134px;
}
.griditemleft .postimage img:after, .griditemright .postimage img:after {
background: url(noise.png) center center;
z-index: -1;
position: absolute;
}
.griditemleft .postimage img:before, .griditemright .postimage img:before {
z-index: -2;
-webkit-transition: all 0.2s;
-webkit-transform: rotate(0deg) rotateY(0);
-webkit-transition-delay: 0;
-moz-transition: all 0.2s;
-moz-transform: rotate(0deg) rotateY(0);
-moz-transition-delay: 0;
-o-transition: all 0.2s;
-o-transform: rotate(0deg) rotateY(0);
-o-transition-delay: 0;
position: absolute;
}
.griditemleft .postimage img:hover:before, .griditemright .postimage img:hover:before {
-webkit-box-shadow: inset 0 0 100px rgba(0,0,0,0.2);
-moz-box-shadow: inset 0 0 100px rgba(0,0,0,0.2);
box-shadow: inset 0 0 100px rgba(0,0,0,0.2);
position: absolute;
}
.griditemleft .postimage img:active, .griditemright .postimage img:active {
-webkit-box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
-moz-box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
}
P.S. Is there any useless css in there?
Thanks
Try removing this line from your class that starts with ".griditemleft .postimage img:hover"...
margin: -10px 0 0 -10px;
I did it here. Is this what you were going for? http://jsfiddle.net/gEYxr/