I would like to align six spans horizontally. I'm using Wordpress to create the page. This is the code: (you can find the Css in the jsFiddle link at the bottom of the question)
HTML
<span class="sixth">
<a href="">
<div class="viewProf view-first">
<img alt="" src="" />
<div class="maskProf">
<h2>Title</h2>
<p>Role</p>
</div>
</div>
</a>
</span>
<span class="sixth">
<a href="">
<div class="viewProf view-first">
<img alt="" src="" />
<div class="maskProf">
<h2>Title</h2>
<p>Role</p>
</div>
</div>
</a>
</span>
[...]
<span class="sixth">
<a href="">
<div class="viewProf view-first">
<img alt="" src="" />
<div class="maskProf">
<h2>Title</h2>
<p>Role</p>
</div>
</div>
</a>
</span>
CSS
.sixth {
width: 13.6%;
vertical-align: bottom;
}
.viewProf {
width: 140px;
height: 140px;
margin: 5px;
float: left;
border: 3px solid #780b07;
border-radius: 7px;
overflow: hidden;
position: relative;
text-align: center;
box-shadow: 4px 4px 6px #444;
cursor: pointer;
}
.viewProf .maskProf,
.viewProf .contentProf {
width: 140px;
height: 140px;
position: absolute;
overflow: hidden;
top: 0;
left: 0
}
.viewProf img {
display: block;
position: relative
}
.viewProf h2 {
text-transform: uppercase;
color: #fff;
text-align: center;
position: relative;
font-size: 13px;
padding: 11px;
background: rgba(0, 0, 0, 0.8);
margin: 20px 0 0 0
}
.viewProf p {
font-family: Georgia, serif;
font-style: italic;
font-size: 12px;
position: relative;
color: #fff;
padding: 15px 25px 25px;
text-align: center
}
.viewProf a.info {
display: inline-block;
text-decoration: none;
padding: 7px 14px;
background: #000;
color: #fff;
text-transform: uppercase;
box-shadow: 0 0 1px #000
}
.viewI a.info:hover {
box-shadow: 0 0 5px #000
}
.view-first .maskProf {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
background-color: rgba(219, 127, 8, 0.7);
-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;
}
.view-first h2 {
-webkit-transform: translateY(-100px);
-moz-transform: translateY(-100px);
-o-transform: translateY(-100px);
-ms-transform: translateY(-100px);
transform: translateY(-100px);
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.view-first p {
-webkit-transform: translateY(100px);
-moz-transform: translateY(100px);
-o-transform: translateY(100px);
-ms-transform: translateY(100px);
transform: translateY(100px);
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
-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;
}
.view-first:hover img {
-webkit-transform: scale(1.1, 1.1);
-moz-transform: scale(1.1, 1.1);
-o-transform: scale(1.1, 1.1);
-ms-transform: scale(1.1, 1.1);
transform: scale(1.1, 1.1);
}
.view-first a.info {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.view-first:hover .maskProf {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
}
.view-first:hover h2,
.view-first:hover p,
.view-first:hover a.info {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-o-transform: translateY(0px);
-ms-transform: translateY(0px);
transform: translateY(0px);
}
.view-first:hover p {
-webkit-transition-delay: 0.1s;
-moz-transition-delay: 0.1s;
-o-transition-delay: 0.1s;
-ms-transition-delay: 0.1s;
transition-delay: 0.1s;
}
.view-first:hover a.info {
-webkit-transition-delay: 0.2s;
-moz-transition-delay: 0.2s;
-o-transition-delay: 0.2s;
-ms-transition-delay: 0.2s;
transition-delay: 0.2s;
}
And this is the result:
How to remove the space at the bottom of the first span?
EDIT
The code in the jsFiddle works but the result in wordpress doesn't. I have tried with different browsers and I got the same problem. What could it be?
http://jsfiddle.net/userK/9zodn23h/
As requested to specify:
Fiddle: http://jsfiddle.net/mptpL5mx/2/
You want to use a clearfix (div that can wrap your floated items and allow them to work properly without breaking outside of itself)
Then you will want to float your items so they line up nicely.
Also clean up your markup (no block level items inside inline items)
HTML:
<div class="holder clearfix">
<span class="sixth">
<div class="viewProf view-first">
<img alt="" src="" />
</div>
</span>
<span class="sixth">
<div class="viewProf view-first">
<img alt="" src="" />
</div>
</span>
<span class="sixth">
<div class="viewProf view-first">
<img alt="" src="" />
</div>
</span>
<span class="sixth">
<div class="viewProf view-first">
<img alt="" src="" />
</div>
</span>
<span class="sixth">
<div class="viewProf view-first">
<img alt="" src="" />
</div>
</span>
<span class="sixth">
<div class="viewProf view-first">
<img alt="" src="" />
</div>
</span>
</div>
CSS:
.clearfix:before,
.clearfix:after {content: ""; display: table;}
.clearfix:after {clear: both;}
.clearfix {zoom: 1;}
.holder{
background-color: #eee;
padding: 10px;
}
.sixth{
height: 50px;
width: 50px;
float: left;
border: 1px solid #000;
background-color: #fff;
margin-right: 5px;
border-radius: 5px;
box-shadow: 3px 3px 3px rgba(0,0,0,0.5);
}
Related
I have some images, and on the :hover effect the figcaption should translateY, on chrome it works perfectly, but on the other browsers it shows the figcaption by default how you see below. Where I'm wrong? My website is on air in case of you want to see it by yourself: https://tiagosilveiraa.github.io
Bug on the other browsers:
Right Chrome:
HTML:
<div class="col-md-4 col-sm-6 col-xs-12">
<figure>
<img src="img/hidrau.png" alt="Hidraurio Mangueiras Hidraulicas" class="img-responsive">
<figcaption>
<button >Visitar</button>
<button >Github</button>
</figcaption>
</figure>
</div>
CSS:
#portfolio figure{
display: table;
position: relative;
overflow: hidden;
padding-bottom: 15px;
}
#portfolio img{
width: 100%;
max-width: 100%;
transition: all 0.4s ease;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
}
#portfolio figure figcaption{
overflow: hidden;
position: absolute;
bottom: -80px;
height: 80px;
width: 100%;
transition: all 0.4s ease;
-webkit-transition: all 0.4s ease;
-moz-transition: all 0.4s ease;
-o-transition: all 0.4s ease;
color: white;
background-color: #292929;
text-align: center;
justify-content: center;
padding-top: 15px;
}
#portfolio figure:hover figcaption {
transform: translateY(-90px);
-webkit-transform: translateY(-90px);
-moz-transform: translateY(-90px);
-ms-transform: translateY(-90px);
}
#portfolio figure:hover img {
opacity: 1;
transform: translateY(-50px);
-webkit-transform: translateY(-50px);
-moz-transform: translateY(-50px);
-ms-transform: translateY(-50px);
}
I'm having some trouble with links. I tryed to make a cool looking hover effect on my images but destoyed the option to click a link. Obviosuly the problem is somewhere in the css transition part... I think the overlay "kills" it but I'm not a expert. Thank you for all your anwasers in advance.
HTML
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>projects</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="css2.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.4.1.min.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
</head>
<body>
<div class="logo" >
<img src="lg.png" alt="" width="180" height="178" class="logo"/>
</div>
<nav> PROJECTS ABOUT CONTACT
</nav>
<div class="ozadje">
<div class="table">
<div class="vrsta">
<div class="okno">
<div class="raste">
<img src="logo.jpg" alt="" width="300"/>
<a href="Logofolio.html" class="transition" ></a>
<div class="mask">
<h2>Logofolio</h2>
<p> Colection of my logos for a veriety of<br> different clients.</p>
</div>
</div>
</div>
<div class="okno">
<div class="raste">
<img src="vodka.jpg" alt="" width="300"/>
<a href="Logofolio.html" class="transition" ></a>
<div class="mask">
<h2>ELITE VODKA</h2>
<p> The idea was make a vodka design stand out from the competiotion and also give a strong symbolistic concept. </p>
</div>
</div>
</div>
<div class="okno">
<div class="raste">
<img src="tamn.jpg" alt="" width="300"/>
<a href="Logofolio.html" class="transition" ></a>
<div class="mask">
<h2>PERFUME DESIGN</h2>
<p> A simplistic perfume design for women. Saying as much as possible, with as little as possible but still achive clarity, balance and harmony. </p>
</div>
</div>
</div>
<div class="vrsta">
<div class="okno">
<div class="raste">
<img src="pedall.jpg" alt="" width="300"/>
<a href="Logofolio.html" class="transition" ></a>
<div class="mask">
<h2>GUITAR PEDAL</h2>
<p> You can have good sounding pedal that looks boring. What it you could have the best of<br> both worlds? </p>
</div>
</div>
</div>
<div class="okno">
<div class="raste">
<img src="keww.jpg" alt="" width="300"/>
<a href="Logofolio.html" class="transition" ></a>
<div class="mask">
<h2>Kew Guide</h2>
<p> Kew garden has a ton of beautiful sites to see all year around. Don't know where to start? Grab a brochure to make your life easy. </p>
</div>
</div>
</div>
<div class="okno">
<div class="raste">
<img src="moca.jpg" alt="" width="300"/>
<a href="Logofolio.html" class="transition" ></a>
<div class="mask">
<h2>MOCA SHOP</h2>
<p> A organic coffee shop design<br> inspired by coffee.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>copyright 2016 matic toni</footer>
</body>
css
#charset "utf-8";
.logo {
padding-bottom: 0.5%;
text-align: center;
}
nav {
font-family: "Proxima";
text-align: center;
font-size: 25px;
word-spacing: 80px;
padding-right: 50px;
padding-bottom: 1%;
padding-left: 50px;
color: #000000;
}
nav:before {
border-radius: 50%;
overflow: hidden;
}
nav:before,
.table {
display: table;
margin: auto;
max-width: 600%;
}
a {
text-decoration: none;
color: black;
}
a:hover {
color: lightgray;
}
a:active {
color: black;
}
body { background-color: #F6F6F6;
margin: 0;
}
.raste img {
display: block;
border: none;
border-radius: 10px;
}
.vrsta{
overflow: hidden;
}
.okno {
display: inline-flex;
flex-wrap: wrap;
justify-content: center;
overflow: hidden;
border-radius: 10px;
}
.raste {
width: 300px;
height: 200px;
margin: 10px;
float: left;
border: solid black;
overflow: hidden;
position: relative;
text-align: center;
cursor: default;
background: black url(../images/bgimg.jpg) no-repeat center center;
border-radius: 10px;
}
.raste .mask,.raste .content {
width: 300px;
height: 200px;
position: absolute;
overflow: hidden;
top: 0;
left: 0;
border-radius: 10px;
}
.raste img {
display: block;
position: relative;
border-radius: 10px;
}
.raste h2 {
text-transform: uppercase;
font-family: sans-serif ;
color: #fff;
text-align: center;
position: relative;
font-size: 17px;
padding: 10px;
background: rgba(0, 0, 0, 0.8);
margin: 20px 0 0 0;
}
.raste p {
font-family: Georgia, serif;
font-style: italic;
font-size: 12px;
position: relative;
color: #fff;
padding: 10px 20px 20px;
text-align: center;
}
.raste img {
-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;
border-radius: 10px;
}
.raste .mask {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
background-color: rgba(149,149,149,0.62) ;
-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;
border-radius: 10px;
}
.raste h2 {
-webkit-transform: translateY(-100px);
-moz-transform: translateY(-100px);
-o-transform: translateY(-100px);
-ms-transform: translateY(-100px);
transform: translateY(-100px);
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
-webkit-transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
-ms-transition: all 0.2s ease-in-out;
transition: all 0.2s ease-in-out;
}
.raste p {
-webkit-transform: translateY(100px);
-moz-transform: translateY(100px);
-o-transform: translateY(100px);
-ms-transform: translateY(100px);
transform: translateY(100px);
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
-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;
}
.raste:hover img {
-webkit-transform: scale(1.1,1.1);
-moz-transform: scale(1.1,1.1);
-o-transform: scale(1.1,1.1);
-ms-transform: scale(1.1,1.1);
transform: scale(1.1,1.1);
border-radius: 10px;
}
.raste:hover .mask {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
}
.raste:hover h2,
.raste:hover p,
.raste:hover a.info {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
-webkit-transform: translateY(0px);
-moz-transform: translateY(0px);
-o-transform: translateY(0px);
-ms-transform: translateY(0px);
transform: translateY(0px);
}
.raste:hover p {
-webkit-transition-delay: 0.1s;
-moz-transition-delay: 0.1s;
-o-transition-delay: 0.1s;
-ms-transition-delay: 0.1s;
transition-delay: 0.1s;
}
.raste:hover a.info {
-webkit-transition-delay: 0.2s;
-moz-transition-delay: 0.2s;
-o-transition-delay: 0.2s;
-ms-transition-delay: 0.2s;
transition-delay: 0.2s;
}
Change your items html like this:
<div class="okno">
<div class="raste">
<a href="Logofolio.html" class="transition" >
<img src="tamn.jpg" alt="" width="300"/>
<div class="mask">
<h2>PERFUME DESIGN</h2>
<p> A simplistic perfume design for women. Saying as much as possible, with as little as possible but still achive clarity, balance and harmony. </p>
</div>
</a>
</div>
</div>
You have to wrap your item inner html in <a> tag :)
I have applied an effect to the image and when I hover over it it moves very strange, it is a move very small but I don't like it, also the text over the image moves when the mouse is out from the image.
This is my code, as you can see is a very imperceptible, but looks strange.
I also would like to make the images responsive when I change resolution, but I would like to have a height like 150px and make the image centered or crop it to the height.
This is my pen code: http://codepen.io/yunielth/pen/wWRydp
HTML
<div class="picture-block margin-0">
<div class="col-lg-3 col-md-6 sub-box-picture">
<div class="content-inner">
<div class="entry-thumbnail">
<div class="thumbnail"><a title="" href="/cursos/madrid"><img src="http://charitywp.thimpress.com/demo-4/wp-content/uploads/sites/6/2016/03/01_home_01_13-370x270.jpg"" alt="" title=""></a></div>
<a class="ciudades" title="" href="">Product 1</a>See more
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 sub-box-picture">
<div class="content-inner">
<div class="entry-thumbnail">
<div class="thumbnail"><a title="" href=""><img src="http://charitywp.thimpress.com/demo-4/wp-content/uploads/sites/6/2016/03/01_home_01_13-370x270.jpg"" alt="" title=""></a></div>
<a class="ciudades" title="" href="">Product 2</a>See more
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 hidden-xs sub-box-picture">
<div class="content-inner">
<div class="entry-thumbnail">
<div class="thumbnail"><a title="" href=""><img src="http://charitywp.thimpress.com/demo-4/wp-content/uploads/sites/6/2016/03/01_home_01_13-370x270.jpg"" alt="" title=""></a></div>
<a class="ciudades" title="" href="">Product 3</a>See more
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 hidden-xs sub-box-picture">
<div class="content-inner">
<div class="entry-thumbnail">
<div class="thumbnail"><a title="" href=""><img src="http://charitywp.thimpress.com/demo-4/wp-content/uploads/sites/6/2016/03/01_home_01_13-370x270.jpg"" alt="" title=""></a></div>
<a class="ciudades" title="" href="">Product 4</a>See more
</div>
</div>
</div>
</div>
CSS
.ciudades{
color: #ffffff;
display: table-cell;
font-size: 24px;
font-weight: 500;
line-height: 25px;
text-align: center;
text-shadow: 1px 2px #333;
vertical-align: middle;
width: 90%;
}
.sub-box-picture .content-inner {
border: none;
background-color: #FFF;
}
.sub-box-picture .entry-thumbnail {
position: relative;
overflow: hidden;
text-align: center;
}
.sub-box-picture .entry-thumbnail .thumbnail::before {
background: #000 none repeat scroll 0 0;
bottom: 0;
content: "";
left: 0;
opacity: 0;
position: absolute;
right: 0;
top: 0;
transition: all 0.3s ease 0s;
z-index: 2;
}
.sub-box-picture .thumbnail {
position: relative;
overflow: hidden;
padding: 0;
}
.sub-box-picture .thumbnail img {
width: 100%;
-webkit-transition: all 1s;
-moz-transition: all 1s;
-o-transition: all 1s;
-ms-transition: all 1s;
transition: all 1s;
-webkit-transition: all all 1s ease;
-moz-transition: all all 1s ease;
-ms-transition: all all 1s ease;
-o-transition: all all 1s ease;
transition: all all 1s ease;
}
.sub-box-picture .thumbnail {
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
border: none;
}
.sub-box-picture .ciudades {
transform: translate(-50%,-50%) scale(1);
-webkit-transform: translate(-50%,-50%) scale(1);
-moz-transform: translate(-50%,-50%) scale(1);
-ms-transform: translate(-50%,-50%) scale(1);
-o-transform: translate(-50%,-50%) scale(1);
left: 50%;
position: absolute;
top: 50%;
z-index: 3;
}
.thim-button.style3 {
display: none;
}
.sub-box-picture a.ciudades {
color: #ffffff;
text-decoration: none;
}
.sub-box-picture:hover .entry-thumbnail .thumbnail::before {
-moz-opacity: .5;
-khtml-opacity: .5;
-webkit-opacity: .5;
opacity: .5;
-ms-filter: alpha(opacity=50);
filter: alpha(opacity=50);
}
.thim-button.style3 {
display: block;
}
.sub-box-picture:hover .thumbnail img {
transform: scale(1.1);
-webkit-transform: scale(1.1);
-moz-transform: scale(1.1);
-ms-transform: scale(1.1);
-o-transform: scale(1.1);
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
}
.sub-box-picture .thim-button.style3 {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%) scale(0);
-webkit-transform: translate(-50%,-50%) scale(0);
-moz-transform: translate(-50%,-50%) scale(0);
-ms-transform: translate(-50%,-50%) scale(0);
-o-transform: translate(-50%,-50%) scale(0);
-webkit-transition: all .5s ease-in-out 0s;
-moz-transition: all .5s ease-in-out 0s;
-o-transition: all .5s ease-in-out 0s;
-ms-transition: all .5s ease-in-out 0s;
transition: all .5s ease-in-out 0s;
-webkit-transition: all .3s ease;
-moz-transition: all .5s ease;
-ms-transition: all .5s ease;
-o-transition: all .5s ease;
transition: all .5s ease;
white-space: nowrap;
z-index: 3;
}
.sub-box-picture:hover .thim-button.style3 {
transform: translate(-50%,-50%) scale(1);
-webkit-transform: translate(-50%,-50%) scale(1);
-moz-transform: translate(-50%,-50%) scale(1);
-ms-transform: translate(-50%,-50%) scale(1);
-o-transform: translate(-50%,-50%) scale(1);
}
.sub-box-picture:hover .ciudades {
transform: translate(-50%,-50%) scale(0);
-webkit-transform: translate(-50%,-50%) scale(0);
-moz-transform: translate(-50%,-50%) scale(0);
-ms-transform: translate(-50%,-50%) scale(0);
-o-transform: translate(-50%,-50%) scale(0);
left: 50%;
position: absolute;
top: 50%;
visibility: hidden;
}
.thim-button.style3 {
background-color: #3080B2;
border-color: #3080B2;
color: #fff;
}
.thim-button.style3:hover {
background-color: #3080B2;
border-color: #3080B2;
text-decoration: none;
}
.thim-button {
border: none;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
font-size: 20px;
line-height: 36px;
padding: 0 20px;
display: inline-block;
}
I'm adapting a portfolio code that was kindly posted by James here: http://codepen.io/SeamlessThemes/pen/LiBdo
I've managed to change most things that I need, but I can't for the life of me get the href to cover the responsive block. At the moment only the "View" link and padding are active.
I'll reproduce the code here so that you don't need to visit codepen if you'd rather not
* {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
}
.view {
width: 32.33%;
height: auto;
margin-right: 0px;
float: left;
border: 1px solid #e5e5e5;
overflow: hidden;
position: relative;
text-align: center;
box-shadow: 1px 1px 2px #e6e6e6;
cursor: default;
background: #079;
}
.view:last-child {
margin-right: 0px;
}
.view .mask, .view .content {
width: 32.33%;
height: 100%;
position: absolute;
overflow: hidden;
top: 0;
left: 0
}
.view img {
display: block;
position: relative;
}
.view h2 {
text-transform: uppercase;
color: #fff;
text-align: center;
position: relative;
font-size: 17px;
padding: 10px;
background: #222;
margin: 20px 0 0 0
}
.view p {
font-family: Georgia, serif;
font-style: italic;
font-size: 12px;
position: relative;
color: #fff;
padding: 10px 20px 20px;
text-align: center
}
.view a.info {
display: inline-block;
text-decoration: none;
padding: 7px 14px;
background: #000;
color: #fff;
text-transform: uppercase;
box-shadow: 0 0 1px #000
}
.view a.info:hover {
box-shadow: 0 0 5px #000
}
.view-portfolio img {
-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;
}
.view-portfolio .mask {
background-color: #222;
-webkit-transform: translateX(-300px);
-moz-transform: translateX(-300px);
-o-transform: translateX(-300px);
-ms-transform: translateX(-300px);
transform: translateX(-300px);
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
-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;
}
.view-portfolio h2 {
background: #222;
color: #FFF;
}
.view-portfolio p {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
color: #FFF;
-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;
}
.view-portfolio:hover .mask {
-webkit-transform: translateX(0px);
-moz-transform: translateX(0px);
-o-transform: translateX(0px);
-ms-transform: translateX(0px);
transform: translateX(0px);
}
.view-portfolio:hover img {
-webkit-transform: translateX(300px);
-moz-transform: translateX(300px);
-o-transform: translateX(300px);
-ms-transform: translateX(300px);
transform: translateX(300px);
}
.view-portfolio:hover p {
-ms-filter: "progid: DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
}
<div class="view view-portfolio">
<img src="http://locallylost.com/chun/files/2013/01/manhattansummer.jpg">
<div class="mask">
<h2>Portfolio Item 1</h2>
<p>This is an example portfolio item exceprt.</p>
View
</div>
</div>
<div class="view view-portfolio">
<img src="http://locallylost.com/chun/files/2013/01/manhattansummer.jpg">
<div class="mask">
<h2>Portfolio Item 2</h2>
<p>This is another example portfolio item exceprt.</p>
View
</div>
</div>
<div class="view view-portfolio">
<img src="http://locallylost.com/chun/files/2013/01/manhattansummer.jpg">
<div class="mask">
<h2>Portfolio Item 3</h2>
<p>This is yet another example portfolio item exceprt.</p>
<a href="#" class="info">View</>
</div>
</div>
.view a.info {
position: absolute;
z-index: 10;
bottom: 0;
width: 100%;
height: 100%;
left: 0;
right: 0;
top: 0;
}
You can adjust it accordingly.
I don't really understand the question but if you want a link on the image...
<div class="view view-portfolio">
<a href="http://www.w3schools.com/html/">
<img src="http://locallylost.com/chun/files/2013/01/manhattansummer.jpg">
</a>
<div class="mask">
<h2>Portfolio Item 1</h2>
<p>This is an example portfolio item exceprt.</p>
View
</div>
</div>
I am trying to animated an image on hover. The result i want to have is similar to this one : See here ( scroll to see the image "Our Team" )
So, I want to have a background where i could display some information ( name, links) exactly like in this theme but I can't achieve it.
Here is my code :
<div class="row">
<div class="col-md-6">
<div class="picture">
<div class="photoapropos center-block">
<div class="info">
<img class="img-responsive img-circle" alt="Name" src="<?= $url; ?>"/>
<p>Name</p>
</div>
</div>
</div>
</div>
</div>
And my CSS :
.picture {
display: block;
opacity: 1;
}
.photoapropos{
display: block;
position: relative;
width: 425px;
height: 425px;
-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;
}
.photoapropos:hover .info {
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
opacity: 1;
}
.photoapropos .info {
position: absolute;
background: #FF8C00;
width: inherit;
height: inherit;
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;
}
Can anyone help me because this feature seemed easy to realise but I don't see what i am missing ?
Thanks.
.picture {
display: block;
opacity: 1;
background:url('http://themes.startbootstrap.com/spectrum-v1.2.0/assets/img/demo-portraits/portrait-4.jpg');
border-radius: 50%;
height: 425px;
width: 425px;
}
.photoapropos{
display: block;
position: relative;
width: 425px;
height: 425px;
-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;
}
.photoapropos:hover .info{
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
opacity: 1;
}
.photoapropos .info {
position: absolute;
/*background: #FF8C00;*/
width: inherit;
height: inherit;
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;
text-align: center;
background: rgba(82, 219, 235, 0.8);
color: #fff;
}
.photoapropos .info p {
margin-top: 50px;
}
<div class="row">
<div class="col-md-6">
<a class="picture" href="<?= $url; ?>">
<div class="photoapropos center-block">
<div class="info">
<p>Name</p>
</div>
</div>
</a>
</div>
</div>
You need to learn how to copy code. Haha!
Please change classes and other things. You can give credit to that site too.
The effect is coming from CSS scale.
.item {
width: 225px;
height: 225px;
margin: 15px auto;
border-radius: 50%;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 15px rgba(244, 245, 247, 0.5);
-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-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}
.item .info {
position: absolute;
background: rgba(82, 219, 235, 0.8);
width: inherit;
height: inherit;
border-radius: 50%;
opacity: 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;
-webkit-transform: scale(0);
-moz-transform: scale(0);
-o-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
-webkit-backface-visibility: hidden;
}
.about-img-1 {
background-image: url(https://www.gravatar.com/avatar/f44f4e56cd6b6a152f0dcfc8412b7069?s=328&d=identicon&r=PG);
}
.visible-xs {
display: none!important;
}
.img-circle {
border-radius: 50%;
}
.item .info h3 {
color: #f4f5f7;
font-size: 24px;
margin: 0 30px;
padding: 45px 0 0 0;
height: 120px;
}
.item .info p {
color: #f4f5f7;
color: rgba(244, 245, 247, 0.8);
padding: 10px 5px;
font-style: italic;
margin: 0 30px;
font-size: 14px;
border-top: 1px solid rgba(244, 245, 247, 0.5);
opacity: 0;
-webkit-transition: all 0.4s ease-in-out 0.4s;
-moz-transition: all 0.4s ease-in-out 0.4s;
-o-transition: all 0.4s ease-in-out 0.4s;
-ms-transition: all 0.4s ease-in-out 0.4s;
transition: all 0.4s ease-in-out 0.4s;
}
.item .info .list-inline {
font-size: 18px;
}
.item .info ul {
opacity: 0;
-webkit-transition: all 0.4s ease-in-out 0.4s;
-moz-transition: all 0.4s ease-in-out 0.4s;
-o-transition: all 0.4s ease-in-out 0.4s;
-ms-transition: all 0.4s ease-in-out 0.4s;
transition: all 0.4s ease-in-out 0.4s;
}
.list-inline {
padding-left: 0;
margin-left: -5px;
list-style: none;
}
.item:hover {
box-shadow: none;
}
.item:hover .info {
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
opacity: 1;
}
.item:hover .info ul {
opacity: 1;
}
<div class="item about-img-1">
<div class="info">
<!-- Mobile Fallback Image -->
<img class="img-responsive img-circle visible-xs" src="https://www.gravatar.com/avatar/f44f4e56cd6b6a152f0dcfc8412b7069?s=328&d=identicon&r=PG" alt="">
<!-- Name / Position / Social Links -->
<h3>Kalpesh Singh</h3>
<p>KnowKalpesh.in</p>
<ul class="list-inline">
<li><a class="light-text" href="#"><i class="fa fa-facebook fa-fw"></i></a>
</li>
<li><a class="light-text" href="#"><i class="fa fa-linkedin fa-fw"></i></a>
</li>
<li><a class="light-text" href="#"><i class="fa fa-twitter fa-fw"></i></a>
</li>
</ul>
</div>
</div>
The hover part use box-shadow and scale transform property with CSS transitions.
Here's the result with the website example code and the relevant CSS part.
.item {
width: 225px;
height: 225px;
margin: 15px auto;
border-radius: 50%;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 15px rgba(244, 245, 247, 0.5);
-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-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}
.item {
margin: 30px;
}
.about-img-1 {
background-image: url(http://themes.startbootstrap.com/spectrum-v1.2.0/assets/img/demo-portraits/portrait-1.jpg);
}
.img-circle {
border-radius: 50%;
}
.item>a>img, .item>img, .img-responsive, .thumbnail a>img, .thumbnail>img {
display: block;
max-width: 100%;
height: auto;
}
img {
-webkit-backface-visibility: hidden;
width: auto\9;
height: auto;
max-width: 100%;
vertical-align: middle;
border: 0;
-ms-interpolation-mode: bicubic;
}
.item .info h3 {
color: #f4f5f7;
font-size: 24px;
margin: 0 30px;
padding: 45px 0 0 0;
height: 120px;
}
.item .info {
position: absolute;
background: rgba(82, 219, 235, 0.8);
width: inherit;
height: inherit;
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;
}
.item:hover .info {
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
opacity: 1;
}
.item:hover {
box-shadow: none;
}
Fiddle
Here is an answer for you in Fiddle: https://jsfiddle.net/uhdtv3nv/
.wrapper {
width: 100%;
height: 100%;
background-color: blue;
}
.item {
width: 225px;
height: 225px;
margin: 15px auto;
border-radius: 50%;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 15px rgba(244, 245, 247, 0.5);
-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-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
background-image: url('http://iconshow.me/media/images/ui/ios7-icons/png/512/person_1.png');
}
.item:hover {
box-shadow: none;
}
.item:hover .info {
-webkit-transform: scale(1);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
opacity: 1;
}
.info {
position: absolute;
background: rgba(82, 219, 235, 0.8);
width: inherit;
height: inherit;
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;
}
.item h3 {
padding: 80px 70px;
}
<div class="wrapper">
<div class="item about-img-1">
<div class="info">
<h3>Some text</h3>
</div>
</div>
</div>