How do I get text to appear when rolling over image? - css

I am brand new to coding.
I am trying to get text to appear when the user rolls over an image, like these images here: http://www.enthusiastic.co/
So far I have this:
#imagelist {
font-size: 0;
}
#imagelist a {
margin: 5px;
display: inline-block;
background: #000;
-webkit-border-radius: 4px;
border-radius: 4px;
}
#imagelist img {
-webkit-border-radius: 3px;
border-radius: 3px;
width: 400px;
height: 300px;
o-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-webkit-transition: all .3s ease-out;
transition: all .3s ease-out;
}
#imagelist img:hover {
opacity: .2;
width: 400px;
height: 300px;
-o-transition: all .3s ease-in;
-ms-transition: all .3s ease-in;
-moz-transition: all .3s ease-in;
-webkit-transition: all .3s ease-in;
transition: all .3s ease-in;
}
#imagelist span {
display: none;
font-size: 13px;
color: red;
}
#imagelist span:hover {
display: block;
}
<div id="imagelist">
<a href="https://google.com" target="_blank">
<img src="http://static2.businessinsider.com/image/4d7533c849e2aec902170000/this-man-can-predict-the-future-our-exclusive-qa-with-christopher-ahlberg-ceo-of-recorded-future.jpg" width="400" height="300">
<span>View</span>
</a>
</div>
I know it has something to do with the span tag but I can't figure it out. Any help would be much appreciated. Thanks.

What you need is to set the :hover action to the a tag and also use absolute position for the span. Check this:
#imagelist {
font-size: 0;
}
#imagelist a {
margin: 5px;
display: inline-block;
background: #000;
-webkit-border-radius: 4px;
border-radius: 4px;
position:relative;
}
#imagelist img {
-webkit-border-radius: 3px;
border-radius: 3px;
width: 400px;
height: 300px;
o-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
-moz-transition: all .3s ease-out;
-webkit-transition: all .3s ease-out;
transition: all .3s ease-out;
}
#imagelist a:hover img{
opacity: .7;
width: 400px;
height: 300px;
-o-transition: all .3s ease-in;
-ms-transition: all .3s ease-in;
-moz-transition: all .3s ease-in;
-webkit-transition: all .3s ease-in;
transition: all .3s ease-in;
}
#imagelist span {
display: none;
font-size: 23px;
color: red;
line-height:300px;
text-align:center;
position:absolute;
top:0;left:0;
width:100%;
}
#imagelist a:hover span{
display: block;
}
<div id="imagelist">
<a href="https://google.com" target="_blank">
<img src="http://static2.businessinsider.com/image/4d7533c849e2aec902170000/this-man-can-predict-the-future-our-exclusive-qa-with-christopher-ahlberg-ceo-of-recorded-future.jpg" width="400" height="300">
<span>View</span>
</a>
</div>

Here's an easy code on bootply:
http://www.bootply.com/90238
It uses bootstraps native features along with this tiny bit of JS
$("[rel='tooltip']").tooltip();
$('.thumbnail').hover(
function(){
$(this).find('.caption').slideDown(250); //.fadeIn(250)
},
function(){
$(this).find('.caption').slideUp(250); //.fadeOut(205)
}
);

Related

adding a hover on image without affecting the border

i have an image and a border around it i want to add blur hover to the image only but the blur covers the image and the border here's the code
.ex{
border-radius: 1000px;
margin-right: 20px;
border: 10px solid #fff;
overflow: hidden
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.ex:hover{
-webkit-filter: blur(5px);
cursor:pointer;
<img src="img/13.jpg" alt="" width="200" height="200" class="ex">
You can wrap the image in a parent element, then that element to create the circle border, and give it a positive z-index so the image doesn't pop out when you apply filter.
.wrap {
width: 200px;
height: 200px;
margin-right: 20px;
position: relative;
}
.wrap {
border-radius: 100%;
overflow: hidden;
z-index: 1;
}
.ex {
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
max-width: 100%;
display: block;
}
.wrap:hover {
cursor: pointer;
}
.wrap:hover .ex {
-webkit-filter: blur(5px);
}
<div class="wrap">
<img src="https://scontent-dft4-1.cdninstagram.com/t51.2885-15/e35/17266233_1741922516118154_2155597975093510144_n.jpg" alt="" class="ex">
</div>
Wrap your image with a div, set the div size and overflow:hidden and you archive that.
.img-wrapper-for-blur {
border-radius: 1000px;
width: 200px;
height: 200px;
overflow: hidden;
}
removing border-radius from your .ex style and the markup changed by this:
<div class="img-wrapper-for-blur">
<img src="img/13.jpg" alt="" width="200" height="200" class="ex">
</div>
Instead of using a border, you can wrap the image in a div, give that div some padding and a white background, and then leave the blur on the image.
HTML
<div class="border">
<img src="http://www.placehold.it/200x200" alt="" width="200" height="200" class="ex">
</div>
CSS
.ex {
border-radius: 100%;
overflow: hidden -webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
.ex:hover {
-webkit-filter: blur(5px);
cursor: pointer;
}
.border {
border-radius: 100%;
margin-right: 20px;
background-color: #fff;
display: inline-block;
padding: 10px;
}
Here is a fiddle: https://jsfiddle.net/fm1hLy6h/

CSS inline block center

I'm trying to center a div element.
Example, its floating left, but it wont be in the center.. ->
Any suggestions?
.grid_3 {
margin-top:20px;
text-align:center;
margin-bottom:20px;
display: inline-block;
margin: 0 auto;
}
.fmcircle_out {
margin:0 auto;
width: 200px;
height: 200px;
background: rgba(221,221,221,0.3);
text-align: center;
opacity: 0.5;
line-height:10px;
border-radius:5px;
border-radius: 100px;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
-o-border-radius: 100px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover {
opacity: 0.8;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover .fmcircle_in img {
margin: 30px 25px 25px 25px;
width: 120px;
height: 120px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_in {
width: 170px;
height: 170px;
margin: 15px;
display: inline-block;
overflow: hidden;
border-radius: 85px;
-moz-border-radius: 85px;
-webkit-border-radius: 85px;
-o-border-radius: 85px;
}
.fmcircle_in img {
border: none;
margin: 53px;
width: 64px;
height: 64px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_in span {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
width: 160px;
background: #fff;
color: #666666;
padding: 5px;
margin: 70px 0 0 0;
height: 50px;
line-height:20px;
text-align: center;
font-weight: bold;
letter-spacing: 0.08em;
text-transform: uppercase;
float: left;
position: absolute;
opacity: 0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-o-border-radius: 5px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover .fmcircle_in span {
opacity: 1;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
}
<div class="grid_3">
<div class="fmcircle_out">
<a href="/article">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett artikkel</span><img src="/img/article.png" alt="" />
</div>
</div>
</a>
</div>
</div>
<div class="grid_3">
<div class="fmcircle_out">
<a href="/event">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett et kurs/event</span><img src="/img/event3.png" alt="" /></center>
</div>
</div>
</a>
</div>
</div>
You can center them by creating a parent div and adding text-align: center;
CSS
.container {
text-align: center;
}
.container {
text-align: center;
}
.grid_3 {
margin-top:20px;
text-align:center;
margin-bottom:20px;
display: inline-block;
margin: 0 auto;
}
.fmcircle_out {
margin:0 auto;
width: 200px;
height: 200px;
background: rgba(221,221,221,0.3);
text-align: center;
opacity: 0.5;
line-height:10px;
border-radius:5px;
border-radius: 100px;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
-o-border-radius: 100px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover {
opacity: 0.8;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover .fmcircle_in img {
margin: 30px 25px 25px 25px;
width: 120px;
height: 120px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_in {
width: 170px;
height: 170px;
margin: 15px;
display: inline-block;
overflow: hidden;
border-radius: 85px;
-moz-border-radius: 85px;
-webkit-border-radius: 85px;
-o-border-radius: 85px;
}
.fmcircle_in img {
border: none;
margin: 53px;
width: 64px;
height: 64px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_in span {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
width: 160px;
background: #fff;
color: #666666;
padding: 5px;
margin: 70px 0 0 0;
height: 50px;
line-height:20px;
text-align: center;
font-weight: bold;
letter-spacing: 0.08em;
text-transform: uppercase;
float: left;
position: absolute;
opacity: 0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-o-border-radius: 5px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover .fmcircle_in span {
opacity: 1;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
}
<div class="container">
<div class="grid_3">
<div class="fmcircle_out">
<a href="/article">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett artikkel</span><img src="/img/article.png" alt="" />
</div>
</div>
</a>
</div>
</div>
<div class="grid_3">
<div class="fmcircle_out">
<a href="/event">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett et kurs/event</span><img src="/img/event3.png" alt="" /></center>
</div>
</div>
</a>
</div>
</div>
</div>
You can use CSS Flexbox. Wrap your grids into a <div> named grid-flex (in my case), and give it following properties:
.grid-flex {
display: flex; /* Flex Container */
align-items: center; /* Vertically center the content */
justify-content: center; /* Horizontally center the content */
}
Also remove the <center> tag too, it is now deprecated.
Have a look at the snippet below:
.grid-flex {
display: flex;
justify-content: center;
align-items: center;
}
.grid_3 {
margin-top: 20px;
text-align:center;
margin-bottom:20px;
}
.fmcircle_out {
margin:0 auto;
width: 200px;
height: 200px;
background: rgba(221,221,221,0.3);
text-align: center;
opacity: 0.5;
line-height:10px;
border-radius:5px;
border-radius: 100px;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
-o-border-radius: 100px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover {
opacity: 0.8;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover .fmcircle_in img {
margin: 30px 25px 25px 25px;
width: 120px;
height: 120px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_in {
width: 170px;
height: 170px;
margin: 15px;
display: inline-block;
overflow: hidden;
border-radius: 85px;
-moz-border-radius: 85px;
-webkit-border-radius: 85px;
-o-border-radius: 85px;
}
.fmcircle_in img {
border: none;
margin: 53px;
width: 64px;
height: 64px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_in span {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
width: 160px;
background: #fff;
color: #666666;
padding: 5px;
margin: 70px 0 0 0;
height: 50px;
line-height:20px;
text-align: center;
font-weight: bold;
letter-spacing: 0.08em;
text-transform: uppercase;
float: left;
position: absolute;
opacity: 0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-o-border-radius: 5px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover .fmcircle_in span {
opacity: 1;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
}
<div class="grid-flex">
<div class="grid_3">
<div class="fmcircle_out">
<a href="/article">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett artikkel</span><img src="/img/article.png" alt="" />
</div>
</div>
</a>
</div>
</div>
<div class="grid_3">
<div class="fmcircle_out">
<a href="/event">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett et kurs/event</span><img src="/img/event3.png" alt="" />
</div>
</div>
</a>
</div>
</div>
</div>
Hope this helps!
Just need a wrapper
The solution is to wrap your two elements in a parent div and then center the parent div.
I wrapped your two elements in a div named wrapper and then referenced the wrapper element and then gave it the following attributes
#wrapper {
margin: 0px auto;
display: table;
}
margin: 0px auto; will horizontally center a container element.
display: table; will make the parent `div auto wrap to the combined children's width.
Working Example
#wrapper {margin: 0px auto; display:table;}
.grid_3 {
margin-top:20px;
text-align:center;
margin-bottom:20px;
display: inline-block;
margin: 0 auto;
}
.fmcircle_out {
margin:0 auto;
width: 200px;
height: 200px;
background: rgba(221,221,221,0.3);
text-align: center;
opacity: 0.5;
line-height:10px;
border-radius:5px;
border-radius: 100px;
-moz-border-radius: 100px;
-webkit-border-radius: 100px;
-o-border-radius: 100px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover {
opacity: 0.8;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover .fmcircle_in img {
margin: 30px 25px 25px 25px;
width: 120px;
height: 120px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_in {
width: 170px;
height: 170px;
margin: 15px;
display: inline-block;
overflow: hidden;
border-radius: 85px;
-moz-border-radius: 85px;
-webkit-border-radius: 85px;
-o-border-radius: 85px;
}
.fmcircle_in img {
border: none;
margin: 53px;
width: 64px;
height: 64px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_in span {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
width: 160px;
background: #fff;
color: #666666;
padding: 5px;
margin: 70px 0 0 0;
height: 50px;
line-height:20px;
text-align: center;
font-weight: bold;
letter-spacing: 0.08em;
text-transform: uppercase;
float: left;
position: absolute;
opacity: 0;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-o-border-radius: 5px;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.fmcircle_out:hover .fmcircle_in span {
opacity: 1;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
-ms-transition: all 0.2s linear;
transition: all 0.2s linear;
}
}
<div id="wrapper">
<div class="grid_3">
<div class="fmcircle_out">
<a href="/article">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett artikkel</span><img src="/img/article.png" alt="" />
</div>
</div>
</a>
</div>
</div>
<div class="grid_3">
<div class="fmcircle_out">
<a href="/event">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett et kurs/event</span><img src="/img/event3.png" alt="" /></center>
</div>
</div>
</a>
</div>
</div>
</div>
If you are looking to centralise the 2 divs you need to wrap them in a parent div and give it a width and then set margin: 0 auto; to that like so:
HTML:
<div class="grid_wrapper">
<div class="grid_3">
<div class="fmcircle_out">
<a href="/article">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett artikkel</span><img src="/img/article.png" alt="" />
</div>
</div>
</a>
</div>
</div>
<div class="grid_3">
<div class="fmcircle_out">
<a href="/event">
<div class="fmcircle_border">
<div class="fmcircle_in fmcircle_blue">
<span>Opprett et kurs/event</span><img src="/img/event3.png" alt="" /></center>
</div>
</div>
</a>
</div>
</div>
</div>
CSS:
.grid_wrapper {
width:500px; //change this to whatever you want
margin: 0 auto;
}

CSS Accordion for Wordpress

Amateur coder here. I am trying to make a responsive accordion for wordpress. I managed to get so far but I have no clue on how make the height of the accordion to auto fit the content.
https://jsfiddle.net/jahangeerm/hbbxgutx/8/
.accordion_mj {
width: auto;
}
.accordion_mj label {
padding: 20px 20px;
position: relative;
display: block;
height: 30px;
cursor: pointer;
color: #fff;
line-height: 40px;
font-size: 19px;
background: #fff;
}
.accordion_mj label:hover {
background: #fff;
}
.accordion_mj input + label {
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.accordion_mj input:checked + label,
.accordion_mj input:checked + label:hover {
background: #fff;
color: #fff;
}
.accordion_mj input {
display: none;
}
.accordion_mj .article {
background: rgb(255, 255, 255);
overflow: hidden;
height: 0px;
-webkit-transition: all 0.3s ease-in-out;
-moz-transition: all 0.3s ease-in-out;
-o-transition: all 0.3s ease-in-out;
-ms-transition: all 0.3s ease-in-out;
transition: all 0.3s ease-in-out;
}
.accordion_mj .article p {
color: #777;
line-height: 23px;
font-size: 14px;
padding: 0px;
}
.accordion_mj input:checked ~ .article {
-webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out;
-ms-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out;
}
.accordion_mj input:checked ~ .article.ac-small {
height: 155px;
}
.accordion_mj input:checked ~ .article.ac-medium {
height: 400px;
}
.accordion_mj input:checked ~ .article.ac-large {
height: 600px;
}
Please help me tweak this to make it fit my content. Thank you.
Just let the height for this class auto, not 470px.
I think this will help you.
.accordion_mj input:checked ~ .article.ac-medium {
height: auto;
}

Safari border does not render one side

I have the following CSS / HTML code:
CSS:
#buttons a {
margin: 0 30px;
display: inline-block;
position: relative;
padding: 9px 3px;
-webkit-transition: background 500ms ease-in-out;
-moz-transition: background 500ms ease-in-out;
-ms-transition: background 500ms ease-in-out;
-o-transition: background 500ms ease-in-out;
transition: background 500ms ease-in-out;
}
#buttons a span{
background: #242424;
font-size: 1.7em;
color: #fffae6;
border: 1px solid #fff;
outline: 4px solid #242424;
position: relative;
width: 100%;
height: 100%;
padding: 5px 40px;
-webkit-transition: background 500ms ease-in-out;
-moz-transition: background 500ms ease-in-out;
-ms-transition: background 500ms ease-in-out;
-o-transition: background 500ms ease-in-out;
transition: background 500ms ease-in-out;
}
HTML:
<a class="restaurant_book_button" href="/book"><span>Book Online</span></a>
How it renders in Safari:
How it renders in Chrome:
Any ideas what could be causing this?
Try box-sizing with -webkit prefix in span because you are using padding while your span width is 100%.

Css Image Hover inside Border-Radius

I'm making an image that can be hovered inside a border-radius with 100%.
And when you hover it the image will scale. Now comes the problem. When I hover it, you will see the image for 1 sec outside the border-radius.
It seems to be working in Firefox. But not in chrome and Safari.
Live Demo:
http://jewelbeast.com/something/imghover/rounded.html
HTML:
<div class="rounded-smallborder">
<section class="img-scale img-opacity" style="width: 250px; height: 250px;">
<img src="http://placehold.it/250x250" />
<div class="text">
<span>
<h1>This is a title</h1>
<ul>
<li>List number 1</li>
<li>List number 2</li>
<li>List number 3</li>
</ul>
</span>
</div>
</section>
</div>
CSS:
div.rounded-smallborder{
margin-top: 22px;
margin-bottom: 22px;
height: 362px;
width: 228px;
float: left;
display: block;
margin-left: 10px;
}
div.rounded-smallborder section{
position: relative;
width: 217px;
height: 217px;
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
-ms-border-radius: 100%;
-o-border-radius: 100%;
border-radius: 100%;
border: 5px solid white;
-webkit-box-shadow: 0px 0px 0px 1px rgba(201, 201, 201, 1);
-moz-box-shadow: 0px 0px 0px 1px rgba(201, 201, 201, 1);
-ms-box-shadow: 0px 0px 0px 1px rgba(201, 201, 201, 1);
-o-box-shadow: 0px 0px 0px 1px rgba(201, 201, 201, 1);
box-shadow: 0px 0px 0px 1px rgba(201, 201, 201, 1);
float:left;
text-align: center;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
overflow: hidden;
background: #dfdfdf;
}
div.rounded-smallborder section img{
position: absolute;
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
left: 0%;
}
div.rounded-smallborder section.img-slideleft:hover img{
margin-left: -35px;
}
div.rounded-smallborder section.img-zoomin:hover img{
width: 550px;
}
div.rounded-smallborder section.img-slideup:hover img{
margin-top: -35px;
}
div.rounded-smallborder section.img-opacity:hover img{
opacity: 0.2;
}
div.rounded-smallborder section.img-diagonal:hover img{
margin-top: -35px;
margin-left: -35px;
}
div.rounded-smallborder section.img-rotation:hover img{
-webkit-transform:rotate(360deg);
-o-transform:rotate(360deg);
-ms-transform:rotate(360deg);
-moz-transform:rotate(360deg);
transform:rotate(360deg);
}
div.rounded-smallborder section.img-scale:hover img{
-webkit-transform:scale(1.45);
-o-transform:scale(1.45);
-moz-transform:scale(1.45);
-ms-transform:scale(1.45);
transform:scale(1.45);
}
/* Text effecten */
div.rounded-smallborder section.txt-slideinleft .text{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-left:-250px;
}
div.rounded-smallborder section.txt-slideinleft:hover .text{
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideinleftTitle .text span h1{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-left:-250px;
}
div.rounded-smallborder section.txt-slideinleftTitle:hover .text span h1{
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideinright .text{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-left:250px;
}
div.rounded-smallborder section.txt-slideinright:hover .text{
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideinrightTitle .text span h1{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-left:250px;
}
div.rounded-smallborder section.txt-slideinrightTitle:hover .text span h1{
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideinleftRightAll .text span h1{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-left:-250px;
}
div.rounded-smallborder section.txt-slideinleftRightAll:hover .text span h1{
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideinleftRightAll .text span p{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-left:250px;
}
div.rounded-smallborder section.txt-slideinleftRightAll:hover .text span p{
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideinleftRightAll .text span a{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
}
div.rounded-smallborder section.txt-slideinleftRightAll:hover .text span a{
}
div.rounded-smallborder section.txt-opacityAll .text span h1{
-webkit-transition: opacity .3s;
-moz-transition: opacity .3s;
-ms-transition: opacity .3s;
-o-transition: opacity .3s;
transition: opacity .3s;
transition-delay: 0s;
-webkit-transition-delay: 0s; /* Safari */
-moz-transition-delay: 0s; /* Safari */
-ms-transition-delay: 0s; /* Safari */
-o-transition-delay: 0s; /* Safari */
opacity: 0;
}
div.rounded-smallborder section.txt-opacityAll:hover .text span h1{
opacity: 1;
}
div.rounded-smallborder section.txt-opacityAll .text span p{
-webkit-transition: opacity .3s;
-moz-transition: opacity .3s;
-ms-transition: opacity .3s;
-o-transition: opacity .3s;
transition: opacity .3s;
transition-delay: .5s;
-webkit-transition-delay: .5s; /* Safari */
-moz-transition-delay: .5s; /* Safari */
-ms-transition-delay: .5s; /* Safari */
-o-transition-delay: .5s; /* Safari */
opacity: 0;
}
div.rounded-smallborder section.txt-opacityAll:hover .text span p{
opacity: 1;
}
div.rounded-smallborder section.txt-opacityAll .text span a{
-webkit-transition: opacity .3s;
-moz-transition: opacity .3s;
-ms-transition: opacity .3s;
-o-transition: opacity .3s;
transition: opacity .3s;
transition-delay: 1s;
-webkit-transition-delay: 1s; /* Safari */
-moz-transition-delay: 1s; /* Safari */
-ms-transition-delay: 1s; /* Safari */
-o-transition-delay: 1s; /* Safari */
opacity: 0;
}
div.rounded-smallborder section.txt-opacityAll:hover .text span a{
opacity: 1;
}
div.rounded-smallborder section.txt-slideintop .text{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-top:-450px;
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideintop:hover .text{
margin-top: 0px;
}
div.rounded-smallborder section.txt-slideinbottom .text{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-top:450px;
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideinbottom:hover .text{
margin-top: 0px;
}
div.rounded-smallborder section.txt-longopacity .text{
-webkit-transition: opacity 1s;
-moz-transition: opacity 1s;
-ms-transition: opacity 1s;
-o-transition: opacity 1s;
transition: opacity 1s;
margin-left: -250px;
opacity: 0;
}
div.rounded-smallborder section.txt-longopacity:hover .text{
margin-left: 0px;
opacity: 1;
}
div.rounded-smallborder section.txt-slideinleftRotation .text{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-left: -250px;
}
div.rounded-smallborder section.txt-slideinleftRotation:hover .text{
margin-left: 0px;
-webkit-transform:rotate(360deg);
-o-transform:rotate(360deg);
-ms-transform:rotate(360deg);
-moz-transform:rotate(360deg);
transform:rotate(360deg);
}
div.rounded-smallborder section.txt-slideinrightRotation .text{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-left:250px;
}
div.rounded-smallborder section.txt-slideinrightRotation:hover .text{
margin-left: 0px;
-webkit-transform:rotate(360deg);
-o-transform:rotate(360deg);
-ms-transform:rotate(360deg);
-moz-transform:rotate(360deg);
transform:rotate(360deg);
}
div.rounded-smallborder section.txt-slideintopRotation .text{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-top: -450px;
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideintopRotation:hover .text{
margin-top: 0px;
-webkit-transform:rotate(360deg);
-o-transform:rotate(360deg);
-ms-transform:rotate(360deg);
-moz-transform:rotate(360deg);
transform:rotate(360deg);
}
div.rounded-smallborder section.txt-slideinbottomRotation .text{
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
margin-top: 450px;
margin-left: 0px;
}
div.rounded-smallborder section.txt-slideinbottomRotation:hover .text{
margin-top: 0px;
-webkit-transform:rotate(360deg);
-o-transform:rotate(360deg);
-ms-transform:rotate(360deg);
-moz-transform:rotate(360deg);
transform:rotate(360deg);
}
/* End of text effecten */
div.rounded-smallborder section .text{
position: absolute;
top: 0;
left: 0;
height: 100%;
width:100%;
display:table;
margin-left: -250px;
}
div.rounded-smallborder section:hover .text{
margin-left: 0px;
}
div.rounded-smallborder section span{
width: 200px;
display: table-cell;
vertical-align: middle;
padding: 20px;
color: black;
opacity: 0;
text-shadow: 1px 1px 0px rgba(255,255,255,0.3);
}
div.rounded-smallborder section:hover span{
opacity: 1;
}
div.rounded-smallborder section:hover img{
opacity: 0.5;
}
div.rounded-smallborder section span h1{
width: 100%;
text-align: center;
font-size: 18px;
font-family: Verdana, sans-serif;
font-weight: bold;
line-height: 25px;
margin-bottom: 3px;
}
div.rounded-smallborder section span p{
width: 100%;
text-align: center;
font-size: 10px;
font-family: Verdana, sans-serif;
font-weight: bold;
margin-bottom: 10px;
}
div.rounded-smallborder section span ul{
list-style-position:inside;
}
div.rounded-smallborder section span ul li{
width: 100%;
text-align: center;
font-size: 10px;
font-family: Verdana, sans-serif;
font-weight: bold;
line-height: 15px;
}
div.rounded-smallborder section span a.button{
display: table;
margin: 0px auto;
text-align: center;
color: white;
text-shadow: none !important;
text-decoration: none;
font-size: 10px;
font-family: Verdana, sans-serif;
font-weight: bold;
padding: 9px 10px 11px 10px;
border: 1px solid #000000;
background: #494949; /* Old browsers */
background: -moz-linear-gradient(top, #494949 1%, #3a3a3a 94%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#494949), color-stop(94%,#3a3a3a)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #494949 1%,#3a3a3a 94%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #494949 1%,#3a3a3a 94%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #494949 1%,#3a3a3a 94%); /* IE10+ */
background: linear-gradient(to bottom, #494949 1%,#3a3a3a 94%); /* W3C */
}
div.rounded-smallborder section span a.entire{
width: 100%;
position: absolute;
top: 0px;
left: 0px;
height: 100%;
}
/* END */
I hope someone know the problem of it.
Sadly it's a bug on chrome Version 27.0.1453.116 m .Which is describe it here bug 62363
It occurs when you use overflow:hidden in mix with transform: scale(1.45)
A workaround, that works well in the design aspect is just remove the overflow:hidden on the div.rounded-smallborder section . (just an option to workaround the issue). You can take a look at the preview here. fiddle example
Hope it helps.
I edited your code see results here
it chrome BUG with scale and overflow .
for the container that have the ( overflow:hidden )
add ( in your case its the div.rounded-smallborder section )
position:relative;
z-index:1;
seems to be an engine bug.
Adding border-radius also to the image tag should solve the problem.
div.rounded-smallborder section img{
position: absolute;
border-radius: 100%; /*added line*/
-webkit-transition: all .3s;
-moz-transition: all .3s;
-ms-transition: all .3s;
-o-transition: all .3s;
transition: all .3s;
left: 0%;
}
http://jsfiddle.net/5RA4m/

Resources