CSS3 Transparency is leaving transparent squares - html

I'm using Chrome and I'm getting these weird transparency squares on my nav.
We tell all of our users to use chrome because we are heavily reliant on HTML5 so other browsers don't really matter.
http://html5test.com/compare/browser/chrome-33/firefox-28/ie-11/safari-7.0.html
This happens when I mouse over and then mouse out on the element.
Any way to get rid of it? or do I just have to live with it until they fix it?
Less
/* Here? */
.transition() {
-moz-transition: all .2s ease-in-out;
-webkit-transition: all .2s ease-in-out;
transition: all .2s ease-in-out;
}
header.site-header {
background: url(http://imgur.com/UEhaqNil.jpg) center no-repeat;
background-color: #2e2e27;
background-size: 100%;
background-position: 100% 95%;
float: left;
width: 100%;
font-family: "Economica", "Open Sans", Arial, sans-serif;
box-shadow: inset 0 0 300px rgba(0, 0, 0, 1); /* Here? */
padding: 50px 10px 10px;
.title-area {
color: rgba(255, 255, 255, 0.8); /* Here? */
float: left;
font-size: 38px;
padding: 16px 0 16px 30px;
h1 {
margin: -10px 0 0;
}
img {
height: 70px;
margin: 0 0 0 35px;
opacity: .8;
}
}
nav.nav-area {
display: block;
float: right;
margin: 80px 10px 0;
ul {
list-style-type: none;
li {
float: left;
margin: 5px;
a {
color: rgba(255, 255, 255, 0.9); /* Here? */
border-radius: 1px;
padding: 8px 10px;
font-weight: 300;
font-size: 22px;
text-transform: uppercase;
&:hover,
&:focus,
&.active {
background: #56BE8E;
color: white;
.transition(); /* Here? */
text-decoration: none;
}
}
}
}
}
}

Related

link button has an underline that cannot be removed, and icon turns red when clicked

I made a "button" well... not really, I made a link that redirects the user to my 'whatever' page or whatever.
problem is, it has an annoyying underline that cannot be removed even when i try puttin in CSS text-decoration: none;
why is it happening?
how can i remove it?
also, whenever i click on the button, the LinkedIn icon turns red.. the button is purple and it makes it ugly.. how can i remove the red color when clicked?
when i am hovering next to the box in the 'peticide' chrome extention, i noticed a red line is it related somehow?
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.title h1 {
font-size: 36px;
font-family: "Lato", sans-serif;
margin-top: 90px;
margin-left: 860px;
margin-right: 10px;
text-align: center;
/* !!!! !!!! Styling the text and giving it gradient *מדרון* !!!! !!!!*/
color: #ffffff;
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip:text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
/* Make sure text is infront of background images */
display: block;
position: relative;
z-index: 3;
}
#keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
#keyframes move-clouds-back {
from {
background-position: 0 0;
}
to {
background-position: 10000px 0;
}
}
.stars,
.twinkling,
.clouds {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
display: block;
}
.stars {
background: #000 url(stars.png) repeat top center;
z-index: 0;
}
.twinkling {
background: transparent url(twinkling.png) repeat top center;
z-index: 1;
animation: move-twink-back 200s linear infinite;
}
.clouds {
background: transparent url(clouds.png) repeat top center;
z-index: 2;
opacity: 0.4;
animation: move-clouds-back 200s linear infinite;
}
.secondarytitle,
h2 {
font-size: 63px;
font-weight: 500;
letter-spacing: 5px;
cursor: pointer;
font-family: "Lato", sans-serif;
margin-top: 90px;
margin-left: 705px;
margin-right: 10px;
text-align: center;
color: #ffffff;
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
display: block;
position: absolute;
z-index: 3;
}
body {
display: flex;
min-height: 100vh;
}
.secondarytitle,
h2 span {
transition: 0.5s;
}
.secondarytitle,
h2:hover span:nth-child(1) {
margin-right: 28px;
}
.secondarytitle,
h2:hover span:nth-child(2)::after {
margin-right: 10px;
}
.secondarytitle,
h2:hover span:nth-child(2)::after {
content: "";
margin-left: 10px;
}
.secondarytitle,
h2:hover span {
color: #fff;
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 40px #fff, 0 0 80px #fff,
0 0 120px #fff;
}
table,
tr,
td,
th{
color: #ffffff;
background: -webkit-linear-gradient(#eee, #333);
font-family: "Lato", sans-serif;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 2;
position: absolute;
font-size: 24px;
font-weight: 600;
}
.tabledata{
top: 400px;
left: 231px;
width: 1200px;
height: 550px;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 2;
}
.button{
font-size: 27px;
font-weight: 800px;
top: 896px;
left: 1233px;
width: 248px;
height: 46px;
color: #ffffff;
letter-spacing: 4px;
background: -webkit-linear-gradient(#eee, #333);
font-family: "consolas", sans-serif;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 3;
position: absolute;
transition: 1.7s;
text-decoration: none;
overflow: hidden;
text-transform: uppercase;
display: inline-block;
cursor: pointer;
}
.button:hover
{
color: #ffffff;
background: #ffffff;
box-shadow: 0 0 10px #ffffff, 0 0 40px #ffffff, 0 0 80px #ffffff;
transition-delay: 0.05s;
}
.secondaryButton{
font-size: 27px;
font-weight: 800px;
top: 896px;
left: 236px;
width: 197px;
height: 50px;
color: #ffffff;
letter-spacing: 4px;
background: -webkit-linear-gradient(#eee, #333);
font-family: "consolas", sans-serif;
-webki
<div class="button">
<a href="/project2/contact.html">
<span></span>
<span></span>
<span></span>
<span></span>
contact me
</div>
<div class="secondaryButton">
<a href="https://www.linkedin.com/in/blah-blah/">
<span></span>
<span></span>
<span></span>
<span></span>
linkedIn<ion-icon name="logo-linkedin"></ion-icon>
</div>
your underline is on a link so you have to remove text-decoratuon on a tag. then on a tag :focus change your color. Look at code below if thats help you.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.title h1 {
font-size: 36px;
font-family: "Lato", sans-serif;
margin-top: 90px;
margin-left: 860px;
margin-right: 10px;
text-align: center;
/* !!!! !!!! Styling the text and giving it gradient *מדרון* !!!! !!!!*/
color: #ffffff;
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip:text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
/* Make sure text is infront of background images */
display: block;
position: relative;
z-index: 3;
}
#keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
#keyframes move-clouds-back {
from {
background-position: 0 0;
}
to {
background-position: 10000px 0;
}
}
.stars,
.twinkling,
.clouds {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
display: block;
}
.stars {
background: #000 url(stars.png) repeat top center;
z-index: 0;
}
.twinkling {
background: transparent url(twinkling.png) repeat top center;
z-index: 1;
animation: move-twink-back 200s linear infinite;
}
.clouds {
background: transparent url(clouds.png) repeat top center;
z-index: 2;
opacity: 0.4;
animation: move-clouds-back 200s linear infinite;
}
.secondarytitle,
h2 {
font-size: 63px;
font-weight: 500;
letter-spacing: 5px;
cursor: pointer;
font-family: "Lato", sans-serif;
margin-top: 90px;
margin-left: 705px;
margin-right: 10px;
text-align: center;
color: #ffffff;
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
display: block;
position: absolute;
z-index: 3;
}
body {
display: flex;
min-height: 100vh;
}
.secondarytitle,
h2 span {
transition: 0.5s;
}
.secondarytitle,
h2:hover span:nth-child(1) {
margin-right: 28px;
}
.secondarytitle,
h2:hover span:nth-child(2)::after {
margin-right: 10px;
}
.secondarytitle,
h2:hover span:nth-child(2)::after {
content: "";
margin-left: 10px;
}
.secondarytitle,
h2:hover span {
color: #fff;
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 40px #fff, 0 0 80px #fff,
0 0 120px #fff;
}
table,
tr,
td,
th{
color: #ffffff;
background: -webkit-linear-gradient(#eee, #333);
font-family: "Lato", sans-serif;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 2;
position: absolute;
font-size: 24px;
font-weight: 600;
}
.tabledata{
top: 400px;
left: 231px;
width: 1200px;
height: 550px;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 2;
}
.button{
font-size: 27px;
font-weight: 800px;
top: 896px;
left: 1233px;
width: 248px;
height: 46px;
color: #ffffff;
letter-spacing: 4px;
background: -webkit-linear-gradient(#eee, #333);
font-family: "consolas", sans-serif;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 3;
position: absolute;
transition: 1.7s;
text-decoration: none;
overflow: hidden;
text-transform: uppercase;
display: inline-block;
cursor: pointer;
}
.button a, .secondaryButton a {text-decoration: none; }
a:focus {color: gray;}
.button:hover
{
color: #ffffff;
background: #ffffff;
box-shadow: 0 0 10px #ffffff, 0 0 40px #ffffff, 0 0 80px #ffffff;
transition-delay: 0.05s;
}
.secondaryButton{
font-size: 27px;
font-weight: 800px;
top: 10px;
left: 236px;
width: 197px;
height: 50px;
color: #ffffff;
letter-spacing: 4px;
background: -webkit-linear-gradient(#eee, #333);
font-family: "consolas", sans-serif;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 4;
position: absolute;
transition: 1.7s;
text-decoration: none;
overflow: hidden;
display: inline-block;
cursor: pointer;
}
.secondaryButton:hover
{
color: rgb(165, 70, 254);
background: rgb(188, 123, 248);
box-shadow: 0 0 10px rgb(165, 70, 254), 0 0 40px rgb(165, 70, 254), 0 0 80px rgb(165, 70, 254);
transition-delay: 0.05s;
}
<div class="button">
<a href="/project2/contact.html">
<span></span>
<span></span>
<span></span>
<span></span>
contact me</a>
</div>
<div class="secondaryButton">
<a href="https://www.linkedin.com/in/blah-blah/">
<span></span>
<span></span>
<span></span>
<span></span>
linkedIn<ion-social-icon name="logo-linkedin">
</div>
Set the CSS of your tag like this
For example:
<a href='xyx.com' class='style'>
CSS
.style{
text-decoration:none
}
Just add your child selector a to the button classes so your button classes are targeting the anchor element...
.button a{
...
}
.button a:hover
{
...
}
.secondaryButton a{
...
}
A better solution is to remove the div wrappers and move your class into the anchor tag directly and also beef up your anchor CSS selectors with pseudo-classes as shown below so you have more granular control of your links.
.button,
.button:link,
.button:visited,
.button:focus,
.button:active{
...
}
.button:hover
{
...
}
.secondaryButton,
.secondaryButton:link,
.secondaryButton:visited,
.secondaryButton:hover,
.secondaryButton:focus,
.secondaryButton:active{
...
}
<a class="button" href="/project2/contact.html">contact me</a>
<a class="secondaryButton" href="https://www.linkedin.com/in/blah-blah/">linkedIn</a>
'''
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.title h1 {
font-size: 36px;
font-family: "Lato", sans-serif;
margin-top: 90px;
margin-left: 860px;
margin-right: 10px;
text-align: center;
/* !!!! !!!! Styling the text and giving it gradient *מדרון* !!!! !!!!*/
color: #ffffff;
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip:text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
/* Make sure text is infront of background images */
display: block;
position: relative;
z-index: 3;
}
#keyframes move-twink-back {
from {
background-position: 0 0;
}
to {
background-position: -10000px 5000px;
}
}
#keyframes move-clouds-back {
from {
background-position: 0 0;
}
to {
background-position: 10000px 0;
}
}
.stars,
.twinkling,
.clouds {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
display: block;
}
.stars {
background: #000 url(stars.png) repeat top center;
z-index: 0;
}
.twinkling {
background: transparent url(twinkling.png) repeat top center;
z-index: 1;
animation: move-twink-back 200s linear infinite;
}
.clouds {
background: transparent url(clouds.png) repeat top center;
z-index: 2;
opacity: 0.4;
animation: move-clouds-back 200s linear infinite;
}
.secondarytitle,
h2 {
font-size: 63px;
font-weight: 500;
letter-spacing: 5px;
cursor: pointer;
font-family: "Lato", sans-serif;
margin-top: 90px;
margin-left: 705px;
margin-right: 10px;
text-align: center;
color: #ffffff;
background: -webkit-linear-gradient(#eee, #333);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
display: block;
position: absolute;
z-index: 3;
}
body {
display: flex;
min-height: 100vh;
}
.secondarytitle,
h2 span {
transition: 0.5s;
}
.secondarytitle,
h2:hover span:nth-child(1) {
margin-right: 28px;
}
.secondarytitle,
h2:hover span:nth-child(2)::after {
margin-right: 10px;
}
.secondarytitle,
h2:hover span:nth-child(2)::after {
content: "";
margin-left: 10px;
}
.secondarytitle,
h2:hover span {
color: #fff;
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 40px #fff, 0 0 80px #fff,
0 0 120px #fff;
}
table,
tr,
td,
th{
color: #ffffff;
background: -webkit-linear-gradient(#eee, #333);
font-family: "Lato", sans-serif;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 2;
position: absolute;
font-size: 24px;
font-weight: 600;
}
.tabledata{
top: 400px;
left: 231px;
width: 1200px;
height: 550px;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 2;
}
.button{
font-size: 27px;
font-weight: 800px;
top: 896px;
left: 1233px;
width: 248px;
height: 46px;
color: #ffffff;
letter-spacing: 4px;
background: -webkit-linear-gradient(#eee, #333);
font-family: "consolas", sans-serif;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 6px 6px 0px rgba(0, 0, 0, 0.2);
z-index: 3;
position: absolute;
transition: 1.7s;
text-decoration: none;
overflow: hidden;
text-transform: uppercase;
display: inline-block;
cursor: pointer;
}
.button:hover
{
color: #ffffff;
background: #ffffff;
box-shadow: 0 0 10px #ffffff, 0 0 40px #ffffff, 0 0 80px #ffffff;
transition-delay: 0.05s;
}
.button a{
text-decoration : none;`
}
.secondaryButton{
font-size: 27px;
font-weight: 800px;
top: 896px;
left: 236px;
width: 197px;
height: 50px;
color: #ffffff;
letter-spacing: 4px;
background: -webkit-linear-gradient(#eee, #333);
font-family: "consolas", sans-serif;
-webki
/* remove the underline and red color when the button is clicked */
/* .button > a {
text-decoration: none;
}
.button > a:focus{
color: black;
}
.secondaryButton > a{
text-decoration: none;
}
.secondaryButton > a:focus{
color: black;
} */
<div class="button">
<a href="/project2/contact.html">
<span></span>
<span></span>
<span></span>
<span></span>
contact me
</div>
<div class="secondaryButton">
<a href="https://www.linkedin.com/in/blah-blah/">
<span></span>
<span></span>
<span></span>
<span></span>
linkedIn<ion-icon name="logo-linkedin"></ion-icon>
</div>
<!-- I suggest like this to make a button or link, just style it -->
<!-- <div class="button">
Contact me
</div>
<div class="secondaryButton">
LinkedIn
</div> -->
I suggest that if you create a button it's better to use the <button></button> tag, if you want to remove the underline, give the <a> element a style text-decoration:none,and your <a> tag has no closing tag </a>

Why doesn't my flexbox hover effects work as expected in IE 11?

I have instituted a flex-grid in my code, however its not functioning as expected in ie11 (i unfortunately need to have it work there too)—Chrome and Firefox both work fine. What seems to happen is when I load in IE11—the flex boxes only load 1 per line and are no longer hovering appropriately.
I am honestly at a loss here... anything I change breaks Chrome and Firefox.
.flex_row {
display: flex;
flex-flow: row wrap;
justify-content: space-around;
}
.flex_col{
flex: 1;
margin: 10px;
}
.circle_shape {
position: relative;
display: flex;
padding: 50% 0;
border-radius: 50%;
overflow: hidden;
border: 1px solid gray;
font-size: 16px;
font-family: 'Source Sans Pro', sans-serif;
justify-content: center;
align-items: center;
background: radial-gradient(circle at 50% 120%, #81e8f6, #76deef 10%, #055194 80%, #062745 100%);
}
.circle_shape:before {
content: "";
position: absolute;
top: 1%;
left: 5%;
width: 90%;
height: 90%;
border-radius: 50%;
background: radial-gradient(circle at 50% 0px, #ffffff, rgba(255, 255, 255, 0) 58%);
filter: blur(5px);
z-index: 2;
}
.circle_shape:hover{
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 1px 2px rgba(0,0,0,0.1);
}
.circle_shape img {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
object-fit: cover;
}
.circle_shape i{
position: absolute;
text-align: center;
font-size: 4vw;
text-shadow:
0 0 1px #fff,
0 1px 2px rgba(0,0,0,0.3);
}
.circle_shape h2 {
position: absolute;
bottom: 10%;
font-size: 1vw;
font-weight: 800;
text-align: center;
}
.circle_text{
position: absolute;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0,51,102, 0.9);
border-radius: 50%;
width: 100%;
height: 100%;
overflow: hidden;
opacity: 0;
transition: all 0.4s ease-in-out;
transform: scale(0);
}
.circle_text p {
color: #fff;
padding: 4px;
text-align: center;
font-size: calc(7px + .5vw);
text-shadow:
0 0 1px #fff,
0 1px 2px rgba(0,0,0,0.3);
}
.circle_shape:hover .circle_text{
transform: scale(1);
opacity: 1;
}
<div class="flex_row">
<a class="flex_col" href="http://www.cnn.com">
<div class="circle_shape">
<i class="fas fa-sitemap"></i>
<div class="circle_text">
<p>Load me some CNN!</p>
</div>
</div>
<div>
<h2>Beep!</h2>
</div>
</a>
<a class="flex_col" href="http://www.cnn.com">
<div class="circle_shape">
<i class="fas fa-sitemap"></i>
<div class="circle_text">
<p>Load me some ABC!</p>
</div>
</div>
<div>
<h2>BIP!</h2>
</div>
</a>
<a class="flex_col" href="http://www.cnn.com">
<div class="circle_shape">
<i class="fas fa-sitemap"></i>
<div class="circle_text">
<p>Load me some BBC!</p>
</div>
</div>
<div>
<h2>BOOP!</h2>
</div>
</a>
</div>
JSFiddle link
IE 11 partially support flex box. Partial support due to large amount of bugs.
Visit the link for more information.
I try to test with the code in IE 11 and try to modify it for testing purpose. I tried many variations in the code but nothing worked so far.
As a work around, I suggest you to refer example below which is working properly in IE and other browsers.
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 0 rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
z-index: 2;
}
.ch-info {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
opacity: 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;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
-webkit-backface-visibility: hidden;
}
li {
position: relative;
overflow: hidden;
border-radius: 100%;
}
li img {
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
.ch-info h3 {
color: #fff;
text-transform: uppercase;
position: relative;
letter-spacing: 2px;
font-size: 22px;
margin: 0 30px;
padding: 65px 0 0 0;
height: 110px;
font-family: 'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}
.ch-info p {
color: #fff;
padding: 10px 5px;
font-style: italic;
margin: 0 30px;
font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
}
.ch-info p a {
display: block;
color: #fff;
color: rgba(255, 255, 255, 0.7);
font-style: normal;
font-weight: 700;
text-transform: uppercase;
font-size: 9px;
letter-spacing: 1px;
padding-top: 4px;
font-family: 'Open Sans', Arial, sans-serif;
}
.ch-info p a:hover {
color: #fff222;
color: rgba(255, 242, 34, 0.8);
}
.ch-item:hover {
box-shadow: inset 0 0 0 110px rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.ch-item:hover .ch-info {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
#import url('normalize.css');
/* General Demo Style */
body{
font-family: Cambria, Georgia, serif;
background: #f9f9f9 url(../images/bg.jpg);
font-weight: 300;
font-size: 15px;
color: #333;
-webkit-font-smoothing: antialiased;
overflow-y: scroll;
overflow-x: hidden;
}
a{
color: #555;
text-decoration: none;
}
.container{
width: 100%;
position: relative;
}
.clr{
clear: both;
padding: 0;
height: 0;
margin: 0;
}
.main{
width: 90%;
margin: 0 auto;
position: relative;
}
.container > header{
margin: 10px;
padding: 20px 10px 10px 10px;
position: relative;
display: block;
text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
text-align: center;
}
.container > header h1{
font-size: 32px;
line-height: 32px;
margin: 0;
position: relative;
font-weight: 300;
color: #777;
text-shadow: 1px 1px 1px rgba(255,255,255,0.7);
}
.container > header h2{
font-size: 14px;
font-weight: 300;
font-style: italic;
margin: 0;
padding: 15px 0 5px 0;
color: #888;
text-shadow: 1px 1px 1px rgba(255,255,255,0.9);
}
/* Header Style */
.codrops-top{
line-height: 24px;
font-size: 11px;
background: #fff;
background: rgba(255, 255, 255, 0.6);
text-transform: uppercase;
z-index: 9999;
position: relative;
box-shadow: 1px 0px 2px rgba(0,0,0,0.1);
}
.codrops-top a{
padding: 0px 10px;
letter-spacing: 1px;
color: #333;
display: inline-block;
}
.codrops-top a:hover{
background: rgba(255,255,255,0.3);
}
.codrops-top span.right{
float: right;
}
.codrops-top span.right a{
float: left;
display: block;
}
/* Demo Buttons Style */
.codrops-demos{
text-align:center;
display: block;
line-height: 30px;
padding: 5px 0px;
}
.codrops-demos a{
display: inline-block;
font-style: italic;
margin: 0px 4px;
padding: 0px 6px;
color: #aaa;
line-height: 20px;
font-size: 13px;
text-shadow: 1px 1px 1px #fff;
border: 1px solid #fff;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */
background: linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
.codrops-demos a:hover{
color: #333;
background: #fff;
}
.codrops-demos a:active{
background: #fff;
}
.codrops-demos a.current-demo,
.codrops-demos a.current-demo:hover{
background: #f0f0f0;
border-color: #d9d9d9;
color: #aaa;
box-shadow: 0 1px 1px rgba(255,255,255,0.7);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f6f6f6', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
}
.support-note span{
color: #ac375d;
font-size: 16px;
display: none;
font-weight: bold;
text-align: center;
padding: 5px 0;
}
.no-cssanimations .support-note span.no-cssanimations,
.no-csstransforms .support-note span.no-csstransforms,
.no-csstransforms3d .support-note span.no-csstransforms3d,
.no-csstransitions .support-note span.no-csstransitions{
display: block;
}
.ch-grid {
margin: 20px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
}
.ch-grid:after,
.ch-item:before {
content: '';
display: table;
}
.ch-grid:after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 220px;
display: inline-block;
margin: 20px;
}
<section class="main">
<ul class="ch-grid">
<li>
<img src="http://tympanus.net/Tutorials/CircleHoverEffects/images/5.jpg" alt="Vision">
<div class="ch-item">
<div class="ch-info">
<h3>Brainiac</h3>
<p>by Daniel Nyari View on Dribbble</p>
</div>
</div>
</li>
</ul>
</section>
Output in IE:
References:
(1) JSFiddle link
(2) Circle Hover Effects with CSS Transitions
Further, you can try to modify the code example as per your requirement.
I just wanted to follow up on this. Rather than rewrite my code -- I decided to hack around it to define a solution.
First step was to identify this is IE 10+ code in my CSS -- i did that through:
#media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
/* IE10+ CSS styles go here */
}
I then redefined my flex_container and flex_item as block (using column code as follows) inside the #media query
[class*="flex_item"] {
float: left;
padding: 15px;
}
.flex_container{
display: block;
overflow: hidden;
box-sizing: border-box;
justify-content: center;
align-items: center;
text-align: center;
flex-direction: none;
font-size: 16px;
}
.flex_item {width: 8.33%;box-sizing: border-box;}
I then went through my code and changed any reference to flex to block within that code. Its a lot of duplication but it essentially got me back to #deepak-MSFTs response.
This effectively resolves my issue.

Activating one button also affects the other?

Here's the demo: https://jsfiddle.net/krycLxb0/
The way this is set up is so that to create the illusion that the button is pressed, the padding of the outer container (.button) is changed, making the top padding more than the bottom. However, when this is activated, the other button seems to shrink down as well. Why does this happen, and how do I fix it?
Here's the source:
header {
letter-spacing: .04em;
font-weight: 900;
font-family: sans-serif;
}
.button {
padding: 4px;
padding-bottom: 12px;
border-radius: 6px;
display: inline-block;
transition: 300ms ease;
will-change: auto;
text-transform: uppercase;
text-align: center;
font-size: 14px;
text-shadow: 0px 4px 0px rgba(0, 0, 0, 0.2);
}
.button span {
display: inline-block;
width: 10em;
padding: 1.2em;
border-radius: 2px;
background: #FF4A50;
}
.button:hover {
box-shadow: 0px 6px 0px 0px rgba(0, 0, 0, 0.2);
}
.button:active {
transition: none;
padding-top: 12px;
padding-bottom: 4px;
}
.button--filled {
background: #BC2E56;
color: white;
}
.button--filled span {
background: #FF4A50;
}
.button--dark {
background: rgba(65, 57, 76, 0.6);
}
.button--dark span {
background: #FFF8F2;
}
<header>
<a class="button button--filled" href="#"><span>Get Started</span></a>
<a class="button button--dark" href="#"><span>Learn more</span></a>
</header>
Because your buttons are now vertical-align: baseline. Just add vertical-align: top; to your .button. See fiddle

Fading a div overflow into adjacent div

I am trying to create a card UI at: https://codepen.io/sarimabbas/pen/qjZYvr
.book_left {
width: 35%;
height: 300px;
float: left;
overflow-x: hidden;
background: transparent;
}
.book_left img {
width: auto;
height: 100%;
border-radius: 10px 0 0 10px;
-webkit-border-radius: 10px 0 0 10px;
-moz-border-radius: 10px 0 0 10px;
position: relative;
}
.book_right {
width: 65%;
height: 300px;
float: left;
background: #000000;
border-radius: 0 10px 10px 0;
-webkit-border-radius: 0 10px 10px 0;
-moz-border-radius: 0 10px 10px 0;
}
The problem I run into is that the left side of the card (which contains an image), can overflow onto the right. Instead of hiding this overflow, I would like to blend it into the div on the right, so that the text is not hidden and can be readable.
Would something like this be possible? I have tried to research combinations of floats, background image fades and divs but have been unsuccessful.
On a related note, what would be the steps needed to make such a card responsive?
I'm not sure I understand completely, but using the below code gives transparency allowing to see the text on top of the overflowed image. With a completely black background that's not an option.
.book_right {
width: 65%;
height: 300px;
float: left;
background: rgba(0,0,0, 0.5);
border-radius: 0 10px 10px 0;
-webkit-border-radius: 0 10px 10px 0;
-moz-border-radius: 0 10px 10px 0;
position: relative;
}
With regard to responsiveness, I would go for a flexbox instead of floats and use percentages instead of pixels for width and height.
#import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);
#import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
.book {
width: 450px;
height: 300px;
background: transparent;
position: static;
left: 0;
right: 0;
margin: auto;
top: 0;
bottom: 0;
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
box-shadow: 0 2px 1px 0 #777;
}
.book_left {
width: 35%;
height: 300px;
float: left;
overflow-x: visible;
background: transparent;
}
.book_left img {
width: auto;
height: 100%;
border-radius: 10px 0 0 10px;
-webkit-border-radius: 10px 0 0 10px;
-moz-border-radius: 10px 0 0 10px;
position: relative;
}
.book_right {
width: 65%;
height: 300px;
float: left;
background: rgba(0,0,0, 0.5);
border-radius: 0 10px 10px 0;
-webkit-border-radius: 0 10px 10px 0;
-moz-border-radius: 0 10px 10px 0;
position: relative;
}
.book_right h1 {
color: white;
font-family: 'Montserrat', sans-serif;
font-weight: 400;
text-align: left;
font-size: 20px;
margin: 30px 0 0 0;
padding: 0 0 0 40px;
letter-spacing: 1px;
}
.book_right_details ul {
list-style-type: none;
padding: 0 0 0 40px;
margin: 10px 0 0 0;
}
.book_right_details ul li {
display: inline;
color: #e3e3e3;
font-family: 'Montserrat', sans-serif;
font-weight: 400;
font-size: 14px;
padding: 0 40px 0 0;
}
.book_right_blurb p {
color: white;
font-family: 'Montserrat', sans-serif;
font-size: 12px;
padding: 0 40px 0 40px;
letter-spacing: 1px;
margin: 10px 0 10px 0;
line-height: 20px;
}
.book_right_blurb a {
text-decoration: none;
font-family: 'Montserrat', sans-serif;
font-size: 14px;
padding: 0 0 0 40px;
color: #2ecc71;
margin: 0;
}
.book_right_button {
padding: 0 0 0 40px;
margin: 15px 0 0 0;
}
.book_right_button a {
color: #2ecc71;
text-decoration: none;
font-family: 'Montserrat', sans-serif;
border: 2px solid #2ecc71;
padding: 5px 5px 5px 5px;
font-size: 12px;
border-radius: 5px;
-webkit-transition-property: all;
transition-property: all;
-webkit-transition-duration: .5s;
transition-duration: .5s;
}
.book_right_button a:hover {
color: #000000;
background-color: #2ecc71;
cursor: pointer;
-webkit-transition-property: all;
transition-property: all;
-webkit-transition-duration: .5s;
transition-duration: .5s;
}
<div class='book'>
<div class='book_left'>
<img src='http://images.gr-assets.com/books/1474171184l/136251.jpg'>
</div>
<div class='book_right'>
<h1>Harry Potter and the Deathly Hallows</h1>
<div class='book_right_details'>
<ul>
<li>JK Rowling</li>
<li>Fiction</li>
</ul>
<div class='book_right_blurb'>
<p>Harry meets his destiny in the final book of Rowling's acclaimed series.</p>
</div>
<div class='book_right_button'>
<a href='https://www.youtube.com/watch?v=ot6C1ZKyiME' target='_blank'>READ BOOK</a>
</div>
</div>
</div>
</div>
There's a few approaches to this problem but the simplest I can think of is something like applying a gradient background to the right hand box and setting .book's background to be black. So something like the following (will need some polishing of course)
#import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);
#import url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);
.book {
width: 450px;
height: 300px;
margin: auto;
border-radius: 10px;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
box-shadow: 0 2px 1px 0 #777;
background: #000;
}
.book_left {
width: 35%;
height: 300px;
float: left;
}
.book_left img {
width: auto;
height: 100%;
border-radius: 10px 0 0 10px;
-webkit-border-radius: 10px 0 0 10px;
-moz-border-radius: 10px 0 0 10px;
/* No need for relative or z-indexes if our layers are in order (later in markup = "higher" layer for position: static) */
}
.book_right {
width: 65%;
height: 300px;
float: left;
border-radius: 0 10px 10px 0;
-webkit-border-radius: 0 10px 10px 0;
-moz-border-radius: 0 10px 10px 0;
/* Gradient that sits on left of right panel - black background has also been applied to .book so that if the image doesn't fit the width we won't end up with weird chunks of missing background */
/* Generated gradient via: http://colorzilla.com/gradient-editor/ then tweaked a little */
background: -moz-linear-gradient(left, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 10px, rgba(0,0,0,1) 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(left, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 10px,rgba(0,0,0,1) 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to right, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 10px,rgba(0,0,0,1) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=1 ); /* IE6-9 */
}
.book_right h1 {
color: white;
font-family: 'Montserrat', sans-serif;
font-weight: 400;
text-align: left;
font-size: 20px;
margin: 30px 0 0 0;
padding: 0 0 0 40px;
letter-spacing: 1px;
}
.book_right_details ul {
list-style-type: none;
padding: 0 0 0 40px;
margin: 10px 0 0 0;
}
.book_right_details ul li {
display: inline;
color: #e3e3e3;
font-family: 'Montserrat', sans-serif;
font-weight: 400;
font-size: 14px;
padding: 0 40px 0 0;
}
.book_right_blurb p {
color: white;
font-family: 'Montserrat', sans-serif;
font-size: 12px;
padding: 0 40px 0 40px;
letter-spacing: 1px;
margin: 10px 0 10px 0;
line-height: 20px;
}
.book_right_blurb a {
text-decoration: none;
font-family: 'Montserrat', sans-serif;
font-size: 14px;
padding: 0 0 0 40px;
color: #2ecc71;
margin: 0;
}
.book_right_button {
padding: 0 0 0 40px;
margin: 15px 0 0 0;
}
.book_right_button a {
color: #2ecc71;
text-decoration: none;
font-family: 'Montserrat', sans-serif;
border: 2px solid #2ecc71;
padding: 5px 5px 5px 5px;
font-size: 12px;
border-radius: 5px;
-webkit-transition-property: all;
transition-property: all;
-webkit-transition-duration: .5s;
transition-duration: .5s;
}
.book_right_button a:hover {
color: #000000;
background-color: #2ecc71;
cursor: pointer;
-webkit-transition-property: all;
transition-property: all;
-webkit-transition-duration: .5s;
transition-duration: .5s;
}
<div class='book'>
<div class='book_left'>
<img src='http://images.gr-assets.com/books/1474171184l/136251.jpg'>
</div>
<div class='book_right'>
<h1>Harry Potter and the Deathly Hallows</h1>
<div class='book_right_details'>
<ul>
<li>JK Rowling</li>
<li>Fiction</li>
</ul>
<div class='book_right_blurb'>
<p>Harry meets his destiny in the final book of Rowling's acclaimed series.</p>
</div>
<div class='book_right_button'>
<a href='https://www.youtube.com/watch?v=ot6C1ZKyiME' target='_blank'>READ BOOK</a>
</div>
</div>
</div>
</div>
Making it responsive you could set a % width on .book and probably float it.
The caveat to my approach is that if the image doesn't overflow it will have a hard edge so it may look strange next to ones that don't do overflow. You could attack this by also setting a percentage width on the images but you'd need to be cautious of images with largely different proportions and ensure that they always cover the 300px height. Alternatively you could set the images as a background image on .book_left and set background-size: cover
I'd usually suggest in this instance to crop images to consistent proportions to avoid the need for fading the overflow as it'll make your life a lot easier in the long run.
An alternate approach to the fade that might be more consistent would be to relatively position .book_left then place an absolutely positioned div within it with a gradient background which is layered on top of the image so something like a div with the following properties added within .book_left
position: absolute;
right: 0;
z-index: 1;
width: 10px;
background: -moz-linear-gradient .....
This combined with an image that fills the container should give you a more consistent look if you want the fade there

How to get Circle Hover Effects with CSS Transitions with img tag?

I want Circle Hover Effects with CSS Transitions on <img> tag without calling the image as background image.
I have created a JSFiddle of the effect I want. But in this fiddle, image is used as a background image. I want same effect, but with image in an img tag, not as background image.
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 0 rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
}
.ch-img-1 {
background-image: url(http://tympanus.net/Tutorials/CircleHoverEffects/images/5.jpg);
}
.ch-img-2 {
background-image: url(http://tympanus.net/Tutorials/CircleHoverEffects/images/5.jpg);
}
.ch-img-3 {
background-image: url(http://tympanus.net/Tutorials/CircleHoverEffects/images/5.jpg);
}
.ch-info {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
opacity: 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;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
-webkit-backface-visibility: hidden;
}
.ch-info h3 {
color: #fff;
text-transform: uppercase;
position: relative;
letter-spacing: 2px;
font-size: 22px;
margin: 0 30px;
padding: 65px 0 0 0;
height: 110px;
font-family: 'Open Sans', Arial, sans-serif;
text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
}
.ch-info p {
color: #fff;
padding: 10px 5px;
font-style: italic;
margin: 0 30px;
font-size: 12px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
}
.ch-info p a {
display: block;
color: #fff;
color: rgba(255, 255, 255, 0.7);
font-style: normal;
font-weight: 700;
text-transform: uppercase;
font-size: 9px;
letter-spacing: 1px;
padding-top: 4px;
font-family: 'Open Sans', Arial, sans-serif;
}
.ch-info p a:hover {
color: #fff222;
color: rgba(255, 242, 34, 0.8);
}
.ch-item:hover {
box-shadow: inset 0 0 0 110px rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.ch-item:hover .ch-info {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
#import url('normalize.css');
/* General Demo Style */
body {
font-family: Cambria, Georgia, serif;
background: #f9f9f9 url(../images/bg.jpg);
font-weight: 300;
font-size: 15px;
color: #333;
-webkit-font-smoothing: antialiased;
overflow-y: scroll;
overflow-x: hidden;
}
a {
color: #555;
text-decoration: none;
}
.container {
width: 100%;
position: relative;
}
.clr {
clear: both;
padding: 0;
height: 0;
margin: 0;
}
.main {
width: 90%;
margin: 0 auto;
position: relative;
}
.container > header {
margin: 10px;
padding: 20px 10px 10px 10px;
position: relative;
display: block;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
text-align: center;
}
.container > header h1 {
font-size: 32px;
line-height: 32px;
margin: 0;
position: relative;
font-weight: 300;
color: #777;
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.7);
}
.container > header h2 {
font-size: 14px;
font-weight: 300;
font-style: italic;
margin: 0;
padding: 15px 0 5px 0;
color: #888;
text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.9);
}
/* Header Style */
.codrops-top {
line-height: 24px;
font-size: 11px;
background: #fff;
background: rgba(255, 255, 255, 0.6);
text-transform: uppercase;
z-index: 9999;
position: relative;
box-shadow: 1px 0px 2px rgba(0, 0, 0, 0.1);
}
.codrops-top a {
padding: 0px 10px;
letter-spacing: 1px;
color: #333;
display: inline-block;
}
.codrops-top a:hover {
background: rgba(255, 255, 255, 0.3);
}
.codrops-top span.right {
float: right;
}
.codrops-top span.right a {
float: left;
display: block;
}
/* Demo Buttons Style */
.codrops-demos {
text-align: center;
display: block;
line-height: 30px;
padding: 5px 0px;
}
.codrops-demos a {
display: inline-block;
font-style: italic;
margin: 0px 4px;
padding: 0px 6px;
color: #aaa;
line-height: 20px;
font-size: 13px;
text-shadow: 1px 1px 1px #fff;
border: 1px solid #fff;
background: #ffffff;
/* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(47%, #f6f6f6), color-stop(100%, #ededed));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* IE10+ */
background: linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%);
/* W3C */
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed', GradientType=0);
/* IE6-9 */
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
.codrops-demos a:hover {
color: #333;
background: #fff;
}
.codrops-demos a:active {
background: #fff;
}
.codrops-demos a.current-demo,
.codrops-demos a.current-demo:hover {
background: #f0f0f0;
border-color: #d9d9d9;
color: #aaa;
box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#f6f6f6', GradientType=0);
/* IE6-9 */
}
.support-note span {
color: #ac375d;
font-size: 16px;
display: none;
font-weight: bold;
text-align: center;
padding: 5px 0;
}
.no-cssanimations .support-note span.no-cssanimations,
.no-csstransforms .support-note span.no-csstransforms,
.no-csstransforms3d .support-note span.no-csstransforms3d,
.no-csstransitions .support-note span.no-csstransitions {
display: block;
}
.ch-grid {
margin: 20px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
}
.ch-grid:after,
.ch-item:before {
content: '';
display: table;
}
.ch-grid:after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 220px;
display: inline-block;
margin: 20px;
}
<section class="main">
<ul class="ch-grid">
<li>
<div class="ch-item ch-img-1">
<div class="ch-info">
<h3>Brainiac</h3>
<p>by Daniel Nyari View on Dribbble
</p>
</div>
</div>
</li>
<li>
<div class="ch-item ch-img-2">
<div class="ch-info">
<h3>Vision</h3>
<p>by Daniel Nyari View on Dribbble
</p>
</div>
</div>
</li>
<li>
<div class="ch-item ch-img-3">
<div class="ch-info">
<h3>Cylon</h3>
<p>by Daniel Nyari View on Dribbble
</p>
</div>
</div>
</li>
</ul>
</section>
I've edited your fiddle here: http://jsfiddle.net/pedwf80h/7/
Essentially I've moved the img url from the background to within the li element. Then positioned the img absolutely and used z-index to move it to the back. The li element then uses overflow: hidden and border-radius: 100% to hide any of the image that goes outside of our li element.
Hope this helps!
Try this may be this can help for you:
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 0 rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
z-index: 2;
}
.ch-info {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
opacity: 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;
-ms-transition: all 0.4s ease-in-out;
transition: all 0.4s ease-in-out;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
-webkit-backface-visibility: hidden;
}
li {
position: relative;
overflow: hidden;
border-radius: 100%;
}
li img {
position: absolute;
top: 0;
left: 0;
z-index: 1;
}
.ch-item:hover {
box-shadow: inset 0 0 0 110px rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.ch-item:hover .ch-info {
opacity: 1;
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
}
#import url('normalize.css');
/* General Demo Style */
body{
font-family: Cambria, Georgia, serif;
background: #f9f9f9 url(../images/bg.jpg);
font-weight: 300;
font-size: 15px;
color: #333;
-webkit-font-smoothing: antialiased;
overflow-y: scroll;
overflow-x: hidden;
}
a{
color: #555;
text-decoration: none;
}
.container{
width: 100%;
position: relative;
}
.clr{
clear: both;
padding: 0;
height: 0;
margin: 0;
}
.main{
width: 90%;
margin: 0 auto;
position: relative;
}
.container > header{
margin: 10px;
padding: 20px 10px 10px 10px;
position: relative;
display: block;
text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
text-align: center;
}
.container > header h1{
font-size: 32px;
line-height: 32px;
margin: 0;
position: relative;
font-weight: 300;
color: #777;
text-shadow: 1px 1px 1px rgba(255,255,255,0.7);
}
.container > header h2{
font-size: 14px;
font-weight: 300;
font-style: italic;
margin: 0;
padding: 15px 0 5px 0;
color: #888;
text-shadow: 1px 1px 1px rgba(255,255,255,0.9);
}
/* Header Style */
.codrops-top{
line-height: 24px;
font-size: 11px;
background: #fff;
background: rgba(255, 255, 255, 0.6);
text-transform: uppercase;
z-index: 9999;
position: relative;
box-shadow: 1px 0px 2px rgba(0,0,0,0.1);
}
.codrops-top a{
padding: 0px 10px;
letter-spacing: 1px;
color: #333;
display: inline-block;
}
.codrops-top a:hover{
background: rgba(255,255,255,0.3);
}
.codrops-top span.right{
float: right;
}
.codrops-top span.right a{
float: left;
display: block;
}
/* Demo Buttons Style */
.codrops-demos{
text-align:center;
display: block;
line-height: 30px;
padding: 5px 0px;
}
.codrops-demos a{
display: inline-block;
font-style: italic;
margin: 0px 4px;
padding: 0px 6px;
color: #aaa;
line-height: 20px;
font-size: 13px;
text-shadow: 1px 1px 1px #fff;
border: 1px solid #fff;
background: #ffffff; /* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */
background: linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
.codrops-demos a:hover{
color: #333;
background: #fff;
}
.codrops-demos a:active{
background: #fff;
}
.codrops-demos a.current-demo,
.codrops-demos a.current-demo:hover{
background: #f0f0f0;
border-color: #d9d9d9;
color: #aaa;
box-shadow: 0 1px 1px rgba(255,255,255,0.7);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f6f6f6', endColorstr='#f6f6f6',GradientType=0 ); /* IE6-9 */
}
.support-note span{
color: #ac375d;
font-size: 16px;
display: none;
font-weight: bold;
text-align: center;
padding: 5px 0;
}
.no-cssanimations .support-note span.no-cssanimations,
.no-csstransforms .support-note span.no-csstransforms,
.no-csstransforms3d .support-note span.no-csstransforms3d,
.no-csstransitions .support-note span.no-csstransitions{
display: block;
}
.ch-grid {
margin: 20px 0 0 0;
padding: 0;
list-style: none;
display: block;
text-align: center;
width: 100%;
}
.ch-grid:after,
.ch-item:before {
content: '';
display: table;
}
.ch-grid:after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 220px;
display: inline-block;
margin: 20px;
}
<section class="main">
<ul class="ch-grid">
<li>
<img src="http://tympanus.net/Tutorials/CircleHoverEffects/images/5.jpg" alt="Vision">
<div class="ch-item">
<div class="ch-info">
</div>
</div>
</li>
</ul>
</section>
Additional reference website...
Reference link
#import url(http://fonts.googleapis.com/css?family=Cabin:700);
body {
padding-top: 2em;
background-color: #c02227;
}
.circle-container {
position: relative;
perspective: 1000;
margin: 0 auto;
}
.circle-container:hover .circle {
transform: rotate3d(45, 45, 0, 180deg);
}
.circle-container:hover .outer-ring {
transform: rotate3d(45, 0, 0, 180deg);
}
.circle-container:hover .outer-outer-ring {
transform: rotate3d(0, 45, 0, 180deg);
}
.circle-container, .front, .back {
width: 175px;
height: 175px;
background-color: rgba(0,0,0,0);
}
.circle, .outer-ring, .outer-outer-ring {
transition: 0.5s;
transform-style: preserve-3d;
transition-timing-function: cubic-bezier(0.785, 0.135, 0.150, 0.860);
}
.circle {
position: relative;
width: 175px;
height: 175px;
}
.front, .back {
border-radius: 50%;
box-shadow: 0px 0px 20px rgba(0,0,0,0.4);
backface-visibility: hidden;
position: absolute;
top: 0;
left: 0;
}
.front {
background-color: #fff;
z-index: 2;
}
.front p {
margin-top: 1.2em;
font-family: cabin, sans-serif;
font-weight: 700;
font-size: 3em;
text-align: center;
color: #c02227;
}
.back {
transform: rotate3d(45,45,0,180deg);
background-color: #fff;
}
.back-logo {
width: 60%;
display: block;
margin: 2em auto;
}
.outer-ring {
position: absolute;
top: -10px;
left: -10px;
border-radius: 50%;
border: 2px solid #fff;
width: 191px;
height: 191px;
background-color: rgba(255,255,255,0);
box-shadow: 0px 0px 20px rgba(0,0,0,0.4);
}
.outer-outer-ring {
position: absolute;
top: -20px;
left: -20px;
border-radius: 50%;
border: 2px solid #fff;
width: 211px;
height: 211px;
background-color: rgba(255,255,255,0);
box-shadow: 0px 0px 20px rgba(0,0,0,0.4);
}