How is possible to get 2d transformation css vertical way - html

I have this with the following CSS 2d Transforms code that built a h2 in horizontal way from the Left side of the Content to the Right.
I'd need the same effect but in the "vertical way", from bottom to top.
Furthermore, I' like to have a gradient color effect from green to Red.
You can find the demo here Link EFFECT 12
.hovereffect {
width: 100%;
height: 100%;
float: left;
overflow: hidden;
position: relative;
text-align: center;
cursor: default;
background: #42b078;
}
.hovereffect .overlay {
width: 100%;
height: 100%;
position: absolute;
overflow: hidden;
top: 0;
left: 0;
padding: 50px 20px;
}
.hovereffect img {
display: block;
position: relative;
max-width: none;
width: calc(100% + 20px);
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: translate3d(-10px,0,0);
transform: translate3d(-10px,0,0);
-webkit-backface-visibility: hidden;
backface-visibility: hidden;
}
.hovereffect:hover img {
opacity: 0.4;
filter: alpha(opacity=40);
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
.hovereffect h2 {
text-transform: uppercase;
color: #fff;
text-align: center;
position: relative;
font-size: 17px;
overflow: hidden;
padding: 0.5em 0;
background-color: transparent;
}
.hovereffect h2:after {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 2px;
background: #fff;
content: '';
-webkit-transition: -webkit-transform 0.35s;
transition: transform 0.35s;
-webkit-transform: translate3d(-100%,0,0);
transform: translate3d(-100%,0,0);
}
.hovereffect:hover h2:after {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
.hovereffect a, .hovereffect p {
color: #FFF;
opacity: 0;
filter: alpha(opacity=0);
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: translate3d(100%,0,0);
transform: translate3d(100%,0,0);
}
.hovereffect:hover a, .hovereffect:hover p {
opacity: 1;
filter: alpha(opacity=100);
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
<div class="hovereffect">
<img class="img-responsive" src="http://placehold.it/350x250" alt="">
<div class="overlay">
<h2>Effect 12</h2>
<p>
LINK HERE
</p>
</div>
</div>
</div>

If you are looking to create a vertical variation of your design, please consider the below effect:
.hovereffect,
.hovereffect img {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
.overlay {
z-index: 10;
position: relative;
text-align: center;
}
.overlay p {
position: relative;
transform: translateY(-100vh);
opacity: 0;
transition: all 0.4s;
}
.hovereffect h2 {
position: relative;
}
.hovereffect h2:after {
content: "";
position: absolute;
top: 100%;
left: 50%;
width: 0;
height: 5px;
background: tomato;
transform: translateY(100vh);
opacity: 0;
transition: all 0.4s;
}
.hovereffect:hover p,
.hovereffect:hover h2:after {
transform: translateY(0);
opacity: 1;
}
.hovereffect:hover h2:after{left:0;width:100%;}
<div class="col-lg-3 col-md-4 col-sm-6 col-xs-12">
<div class="hovereffect">
<img class="img-responsive" src="http://placehold.it/350x250" alt="">
<div class="overlay">
<h2>Effect 12</h2>
<p>
LINK HERE
</p>
</div>
</div>
</div>

Related

CSS how can I make text appear next to an image on hover instead of on it?

I've been trying to figure out how I can make a block of text appear to the side of an image when hovered over instead of appearing on top of it, however I can't seem to find any explanations for anything other than having the text fade in on the actual image itself. This is what I've been experimenting with(adapted from w3schools), as of right now it only has the text on the image. If anyone could edit it so that the text comes to the side that would be incredibly helpful.
.container {
position: relative;
width: 50%;
}
.image {
opacity: 1;
display: block;
width: 100%;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
}
.middle {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center;
}
.container:hover .image {
opacity: 0.3;
}
.container:hover .middle {
opacity: 1;
}
.text {
color: black;
font-size: 16px;
padding: 16px 32px;
}
<div class="container">
<img src="https://miro.medium.com/max/1200/1*mk1-6aYaf_Bes1E3Imhc0A.jpeg" alt="placeholder" class="image" style="width:100%">
<div class="middle">
<div class="text">This should be to the side of the image</div>
</div>
</div>
If I understand correctly, you want the text to be outside of the image.
You are using position: relative on the .container, that's why the .middle will stay inside of it, removing that will solve the issue:
.container {
/* position: relative; */
width: 50%;
}
.image {
opacity: 1;
display: block;
width: 100%;
height: auto;
transition: .5s ease;
backface-visibility: hidden;
}
.middle {
transition: .5s ease;
opacity: 0;
position: absolute;
top: 0;
left: 50%;
/* transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
text-align: center; */
}
.container:hover .image {
opacity: 0.3;
}
.container:hover .middle {
opacity: 1;
}
.text {
color: black;
font-size: 16px;
padding: 16px 32px;
}
<div class="container">
<img src="https://via.placeholder.com/350x150" alt="placeholder" class="image" style="width:100%">
<div class="middle">
<div class="text">This should be to the side of the image</div>
</div>
</div>
Check if that's what you need (made myself a quick example) :
.container {
display: flex;
}
.leftBlock {
width: 50%;
height: auto;
transition: all 0.3s ease;
}
.leftBlock:hover {
opacity: 0.5;
}
.leftBlock:hover + .rightBlock {
opacity: 1;
}
.rightBlock {
right: 0;
background-color: #222;
flex-grow: 1;
text-align: center;
vertical-align: middle;
opacity: 0;
transition: all 0.4s ease;
color: #fff;
}
<div class="container">
<img src="https://images.pexels.com/photos/3683056/pexels-photo-3683056.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940" class="leftBlock">
<div class="rightBlock">Text Goes Here</div>
</div>

Fixing image width on hover with CSS animation

I am new with CSS3 animation. Currently, I'm trying to move the image in an element by 40px to left when the container is hovered, but every time the image is hovered it will give an empty space to the right side of the container. I have tried to give the image a bigger width to ensure it not giving any empty space when being hovered, but it doesn't work.
I'm not really sure how to word it, so I put a screenshot here. The red arrow shows the empty space left when the container is hovered.
Screenshot of the said problem
This is the HTML and CSS code of the said element:
HTML:
<ul>
<li class="opinion card wrapper">
<div id="card" class="opinion card container">
<div class="opinion card image variation-3">
</div>
<div class="opinion card text variation-3">
<a href="">
<h2 class="opinion card headline">
<span class="highlight">Contoh judul pendek yang agak panjang tapi panjang</span>
</h2>
</a>
<a href="/author" class="opinion card author link">
<span class="highlight noTransition">Author Name</span>
</a>
<a href="/author" class="opinion card date link">
<span class="highlight noTransition">Publication Date</span>
</a>
<p class="opinion card description">
Indoor air pollution gets surprisingly little attention for such a lethal public health problem. It kills more people each year than HIV/AIDS and malaria combined, but few countries treat it as a crisis on the same level.
</p>
</div>
</div>
</li>
</ul>
CSS
.opinion.card.wrapper {
position: relative;
display: inline-block;
float: left;
width: 25%;
margin:0;
padding: 0;
overflow: hidden;
color: white;
box-sizing: border-box;
background: transparent;
}
.card.wrapper {
height: 618px;
}
.opinion.card.container {
overflow: hidden;
height: inherit;
display: block;
margin: 15px;
position: relative;
}
.opinion.card.article.link {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
z-index: 3;
}
.opinion.card.author.link {
z-index: 1;
}
.opinion.card.image {
background: url("https://i.imgur.com/SvO0n5b.jpg") no-repeat;
background-position: center, center;
background-size: cover;
display: block;
height: inherit;
overflow: hidden;
position: absolute;
top: 0;
width: 150%;
cursor: pointer;
}
.opinion.card.image.variation-3 {
background-image: url("https://i.imgur.com/SvO0n5b.jpg");
position: relative;
float: left;
overflow: hidden;
display: block;
min-height: 100%;
max-width: 100%;
opacity: 0.8;
max-width: none;
width: 100%;
height: -webkit-calc(100% + 50px);
height: calc(100% + 50px);
-webkit-filter: contrast(1.05) brightness(1.1);
filter: contrast(1.05) brightness(1.1);
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;/*
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;*/
}
.opinion.card.image.variation-2:before,
.opinion.card.image.variation-3:before {
content: "";
position: absolute;
height: 150%;
top:-200;
left: 0;
bottom: 0;
right: 0;
opacity: 0;
overflow:hidden;
}
.opinion.card.image.variation-3:before {
background-color: rgba(0,0,0,0.3);
opacity: 0;
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: translate3d(0,50px,0);
transform: translate3d(0,50px,0);
}
.opinion.card.text {
float: left;
text-align: left;
margin: 30px 30px 45px 30px;
position: absolute;
bottom: 0;
left: 0;
}
.opinion.card.text.variation-3 {
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: translate3d(0,50px,0);
transform: translate3d(0,50px,0);
}
.opinion.card.headline {
font-family: "Patua One", "Georgia", serif;
font-size: 40px;
font-size: 2.2222rem;
color: #fff;
margin-bottom: 10px;
position: relative;
}
.opinion.card.author,
.opinion.card.date {
font-family: "Roboto Condensed", "Arial Narrow", sans-serif;
font-size: 18px;
font-size: 1rem;
color: #505eea;
position: relative;
}
.opinion.card.description {
font-family: "Roboto", "Arial", sans-serif;
font-size: 16px;
font-size: 0.8889rem;
font-style: italic;
color: #f1f1f1;
width: 90%;
margin-top: 30px;
line-height: 1.5;
-webkit-transform: translate3d(0,100%,0);
transform: translate3d(0,100%,0);
opacity: 0;
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
}
.opinion.card.description:before {
position: absolute;
top: -15px;
left: 0;
width: 100%;
height: 5px;
background: #fff;
content: "";
-webkit-transform: translate3d(0,40px,0);
transform: translate3d(0,40px,0);
}
.opinion.card .highlight {
background-color: #000;
padding: 5px;
}
.opinion.card.container:hover .opinion.card.image {
opacity: 1;
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
.opinion.card.container:hover .opinion.card.image.variation-3 {
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: translate3d(-40px,0, 0);
transform: translate3d(-40px,0,0);
width: 100%;
}
.opinion.card.container:hover .opinion.card.image.variation-2:before {
opacity: 1;
/*background-color: rgba(0,0,0,0.2);*/
background-image: url(img/pattern_2.png);
}
.opinion.card.container:hover .opinion.card.image.variation-3:before,
.opinion.card.container:hover .opinion.card.container:after {
opacity: 1;
-webkit-transition: -webkit-transform 0.35s;
transition: transform 0.35s;
}
.opinion.card.container:hover .opinion.card.container:after,
.opinion.card.container:hover .opinion.card.description:before, {
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
.opinion.card.container:hover .opinion.card.text.variation-3,
.opinion.card.container:hover .opinion.card.description:before {
-webkit-transform: translate3d(0,0,0) scale(1);
transform: translate3d(0,0,0) scale(1);
}
.opinion.card.container:hover .opinion.card.description,
.opinion.card.container:hover .opinion.card.container:after {
opacity: 1;
-webkit-transform: translate3d(0,0,0) scale(1);
transform: translate3d(0,0,0) scale(1);
}
.opinion.card.container:hover .opinion.card.container:after {
width: 100%;
height: 100%;
}
.opinion.card.container:hover .opinion.card.headline {
color: #505eea;
transition: 0.3s ease-in-out;
}
.opinion.card.container:hover .opinion.card.author {
transition: color 0s;
}
a.opinion.card.author:hover {
color: #fff;
transition: all 0.3s ease-in-out;
}
#media (min-width: 1280px) {
.home.container {
margin: auto;
max-width: 1200px;
}
.card.wrapper {
height: 618px;
}
.opinion.card.wrapper {
display: inline-block;
width: 33.3333333%;
min-width: 33.3333333%;
}
.opinion.card.wrapper:first-child {
width: 66.66666666666%;
}
}
JSFiddle: https://jsfiddle.net/fatzjuhe/1/
I don't own the image used here, I just took a random picture from Imgur for better viewing.
Any help will be very much appreciated. Thank you!
I have solved my own problem. Basically, I messed up with the max-width and min-width properties in the .variation-3 class. I also defined the width property of the hovered image (should be inherited from the image state before being hovered ). It works perfectly now.
.opinion.card.image.variation-3 {
background-image: url("https://i.imgur.com/SvO0n5b.jpg");
float: left;
overflow: hidden;
display: block;
width: 120%;
-webkit-filter: contrast(1.05) brightness(1.1);
filter: contrast(1.05) brightness(1.1);
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
}
.opinion.card.container:hover .opinion.card.image.variation-3 {
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: translate3d(-40px,0, 0);
transform: translate3d(-40px,0,0);
}
Thank you!
JSFIDDLE: https://jsfiddle.net/fatzjuhe/2/

Make Image overlay clickable to link to another page

jsfiddle: https://jsfiddle.net/e0u4sow1/
I want to use the following code for an image to link to another page. Right now if I make it a link it doesn't work. I read somewhere I need to add
pointer-events: none;
somewhere in the code. It tried, but it either doesn't work or it works but removes the overlay.
HTML:
<h1>MR Cube</h1>
<div class="media"></div>
<div class="media"><img alt="" class="media__image" src="http://www.webwinkelsucces.nl/wp-content/uploads/2015/05/1112625-les-outils-de-test-et-d-integration-continue-open-source.jpg" />
<div class="media__body">
<h1>Lees meer</h1>
</div>
</div>
CSS:
.media {
display: inline-block;
position: relative;
vertical-align: top;
}
.media__image { display: block; }
.media__body {
background: rgba(41, 128, 185, 0.7);
bottom: 0;
color: white;
font-size: 1em;
left: 0;
opacity: 0;
overflow: hidden;
padding: 3.75em 3em;
position: absolute;
text-align: center;
top: 0;
right: 0;
-webkit-transition: 0.6s;
transition: 0.6s;
}
.media__body:hover { opacity: 1; }
.media__body:after,
.media__body:before {
border: 1px solid rgba(255, 255, 255, 0.7);
bottom: 1em;
content: '';
left: 1em;
opacity: 0;
position: absolute;
right: 1em;
top: 1em;
-webkit-transform: scale(1.5);
-ms-transform: scale(1.5);
transform: scale(1.5);
-webkit-transition: 0.6s 0.2s;
transition: 0.6s 0.2s;
}
.media__body:before {
border-bottom: none;
border-top: none;
left: 2em;
right: 2em;
}
.media__body:after {
border-left: none;
border-right: none;
bottom: 2em;
top: 2em;
}
.media__body:hover:after,
.media__body:hover:before {
-webkit-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
opacity: 1;
}
.media__body h2 { margin-top: 0; }
.media__body p { margin-bottom: 1.5em; }
move .media__body inside a
<a href="http://www.google.nl/">
<img alt="" class="media__image" src="http://www.webwinkelsucces.nl/wp-content/uploads/2015/05/1112625-les-outils-de-test-et-d-integration-continue-open-source.jpg" />
<div class="media__body">
<h1>Lees meer</h1>
</div>
</a>
check this fiddle
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.image-container{
width:200px;
position:relative;
overflow: hidden;
}
.image-container img {
max-width: 100%;
height: auto;
display: block; /* added this */
}
.image-container a {
position:absolute;
color: #fff;
width: 100%;
height: 100%;
top: 0;
left: 0;
padding: 0;
z-index:2;
}
.image-container .image-overlay{
opacity:0;
position:absolute;
color: #fff;
background: rgba(141, 178, 215, 0.77);
width: 100%;
height: 100%;
top: 0;
left: 0;
padding: 0;
text-align:center;
font-size:40px;
line-height: 200px; /* added this */
-webkit-transition: opacity .5s ease-in-out;
-moz-transition: opacity .5s ease-in-out;
-ms-transition: opacity .5s ease-in-out;
-o-transition: opacity .5s ease-in-out;
transition: opacity .5s ease-in-out;
z-index:1;
}
.image-container:hover .image-overlay{
opacity:1;
}
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<div class="image-container">
<div class="image-overlay">
<i class="fa fa-search"></i>
</div>
<img src="https://placehold.it/350x350">
</div>
Although JQuery has not been tagged, this is what you could have done using it:
$(".media__body").click(function(){
window.location = "http://www.google.com/";
});
Here is a Demo
Here is the solution, just wrap all tags used for image with <a> tag
Demo
<h1>MR Cube</h1>
<a href="www.google.com" >
<div class="media"></div>
<div class="media"><img alt="" class="media__image" src="http://www.webwinkelsucces.nl/wp-content/uploads/2015/05/1112625-les-outils-de-test-et-d-integration-continue-open-source.jpg" />
<div class="media__body">
<h1>Lees meer</h1>
</div>
</div>
</a>

How do I vertically center caption on img hover?

I am currently having problems centering my caption inside a div upon hover. The image inside the div is bigger than the div and I want the caption to be vertically centered inside that div?
HTML
<div class="container-fluid">
<div id="page">
<!-- GRID ITEM -->
<div class="item s1">
<a href="#">
<div class="grid-image">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Pleiades_large.jpg/1024px-Pleiades_large.jpg">
</div>
<div class="item-caption">
<h5>I want this to be center</h5>
</div>
</a>
</div>
<!-- /GRID ITEM -->
</div>
</div>
CSS
#page .item {
width: calc(16.66% - 10px);
display: inline-block;
height: 0;
float: left;
padding-bottom: 16.66%;
overflow: hidden;
background-color: salmon;
margin: 5px;
position: relative;
}
#page .item.s1 {
width: calc(50% - 10px);
padding-bottom: 50%;
overflow: hidden;
background-color: navy;
}
.item > a {
position: relative;
display: block;
overflow: hidden;
color: white;
}
.item:hover .grid-image:after {
background: rgba(0, 0, 0, .7);
}
.item:hover .grid-image > img {
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1);
}
.item:hover .item-caption {
opacity: 1;
z-index: 3;
visibility: visible;
}
.item-caption,
.grid-image > img,
.grid-image:after {
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
-ms-transition: all 0.3s ease-in-out 0s;
-o-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.item-caption {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(29, 106, 154, 0.72);
color: #fff;
visibility: hidden;
text-align: center;
opacity: 0;
}
.grid-image {
position: relative;
overflow: hidden;
}
.grid-image img {
display: block;
overflow: hidden;
}
.grid-image:after {
position: absolute;
display: block;
content: "";
height: 100%;
width: 100%;
top: 0;
left: 0;
}
JavaScript
var $container = $('#page');
$container.masonry({
columnWidth: '.grid-sizer',
itemSelector: '.item',
percentPosition: true,
gutter: 10
});
Here's a fiddle
Thank you!
try this: http://jsfiddle.net/2stywe2t/1/
What I did:
Add a new div to your HTML, right under .item-caption.
Gave .item-caption the display: table attribute and a few others
Gave the new div display: table-cell, and vertical-align: middle
Removed position:relative from the a ancestor
Make sense?
Got the answer !! Just tidy up your code a bit.
var $container = $('#page');
$container.masonry({
columnWidth: '.grid-sizer',
itemSelector: '.item',
percentPosition: true,
gutter: 10
});
#page .item {
width: calc(16.66% - 10px);
display: inline-block;
height: 0;
float: left;
padding-bottom: 16.66%;
overflow: hidden;
background-color: salmon;
margin: 5px;
position: relative;
}
#page .item.s1 {
width: calc(50% - 10px);
padding-bottom: 50%;
overflow: hidden;
background-color: navy;
position: relative!important;
}
.item > a {
position: absolute;
display: block;
width: 100%;
height: 100%;
overflow: hidden;
color: white;
}
.item:hover .grid-image:after {
background: rgba(0, 0, 0, .7);
}
.item:hover .grid-image > img {
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
transform: scale(1.1);
}
.item:hover .item-caption {
opacity: 1;
z-index: 3;
visibility: visible;
}
.item-caption, .grid-image > img, .grid-image:after {
-webkit-transition: all 0.3s ease-in-out 0s;
-moz-transition: all 0.3s ease-in-out 0s;
-ms-transition: all 0.3s ease-in-out 0s;
-o-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
.item-caption {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(29, 106, 154, 0.72);
color: #fff;
visibility: hidden;
text-align: center;
opacity: 0;
display: table;
height: 100%;
width: 100%;
}
.grid-image {
position: relative;
overflow: hidden;
}
.grid-image img {
display: block;
overflow: hidden;
}
.grid-image:after {
position: absolute;
display: block;
content:"";
height: 100%;
width: 100%;
top: 0;
left: 0;
}
h5 {
display: table-cell;
vertical-align: middle;
}
<div class="container-fluid">
<div id="page">
<!-- GRID ITEM -->
<div class="item s1"> <a href="#">
<div class="grid-image">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Pleiades_large.jpg/1024px-Pleiades_large.jpg">
</div>
<div class="item-caption">
<h5>I want this to be center</h5>
</div>
</a>
</div>
<!-- /GRID ITEM -->
</div>
</div>
</body>
</html>
You simply need to add one line of code to your CSS to make this work:
h5 {
margin-top: 50%;
transform: translateY(-50%); /* not entirely necessary, but makes centering precise */
}
DEMO: http://jsfiddle.net/2stywe2t/4/

Image height in safari

I have a problem with some image in safari. It is working everywhere but not in safari. I've some images on my site but on safari the image's are going way to high.
The website is development.mar-bakker.nl
<div class="col-xs-12 col-sm-4 col-md-4">
<div class="grid wow zoomIn">
<figure class="effect-bubba">
<img src="assets/images/item-2.jpg" class="img-responsive" alt="img01"/>
<figcaption>
<h2>Webshop <span>PC4U</span></h2>
<p>Lily likes to play with crayons and pencils</p>
</figcaption>
</figure>
</div>
</div>
And the css is this:
figure.effect-bubba {
background: #9e5406;
}
figure.effect-bubba img {
opacity: 0.7;
-webkit-transition: opacity 0.35s;
transition: opacity 0.35s;
}
figure.effect-bubba:hover img {
opacity: 0.4;
}
figure.effect-bubba figcaption::before,
figure.effect-bubba figcaption::after {
position: absolute;
top: 30px;
right: 30px;
bottom: 30px;
left: 30px;
content: '';
opacity: 0;
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
}
figure.effect-bubba figcaption::before {
border-top: 1px solid #fff;
border-bottom: 1px solid #fff;
-webkit-transform: scale(0,1);
transform: scale(0,1);
}
figure.effect-bubba figcaption::after {
border-right: 1px solid #fff;
border-left: 1px solid #fff;
-webkit-transform: scale(1,0);
transform: scale(1,0);
}
figure.effect-bubba h2 {
padding-top: 10%;
-webkit-transition: -webkit-transform 0.35s;
transition: transform 0.35s;
-webkit-transform: translate3d(0,-20px,0);
transform: translate3d(0,-20px,0);
color: #fff;
}
figure.effect-bubba p {
padding: 20px 2.5em;
opacity: 0;
-webkit-transition: opacity 0.35s, -webkit-transform 0.35s;
transition: opacity 0.35s, transform 0.35s;
-webkit-transform: translate3d(0,20px,0);
transform: translate3d(0,20px,0);
}
figure.effect-bubba:hover figcaption::before,
figure.effect-bubba:hover figcaption::after {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1);
}
figure.effect-bubba:hover h2,
figure.effect-bubba:hover p {
opacity: 1;
-webkit-transform: translate3d(0,0,0);
transform: translate3d(0,0,0);
}
Can someone help me.
i found the error! it was by a diffent css element
.grid figure figcaption, .grid figure figcaption > a {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
Try to remove the max-width and min-height definitions in the .grid figure img selector
.grid figure img {
position: relative;
display: block;
/* min-height: 100%; */
/* max-width: 100%; */
opacity: 0.8;
}