How do I make effect like this on image hover? - html

I want to give effect like this on image hover http://mahno.com.ua/en/architecture. Tried this but how to hide image on hover and display name .I have used CSS: On hover show and hide different div's at the same time? but having no luck.
EDIT: Want that effect in this code
<div class="content">
<div class="content-wrap">
<div>
<div>
<h1 class="title">Architecture</h1>
</div>
<!--section-title end-->
<div>
<div>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/6151-fsdgsfg.gif">
</a>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/6923-KUB%207.jpg">
</a>
</div>
<div>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/7093-3.jpg">
</a>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/1562-d.jpg">
</a>
</div>
<div>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/5548-pddf.jpg">
</a>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/1562-d.jpg">
</a>
</div>
<div>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/1586-fdgsfgsdfggsdfgs.jpg">
</a>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/1597-dogs.jpg">
</a>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/6155-Untitled-3.gif">
</a>
</div>
<div>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/3405-klink-mal.jpg">
</a>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/6128-ghrt1.jpg">
</a>
<span class="tim">Kube house</span>
<a href="#">
<img src="images/1555-dsfsdfds.jpg">
</a>
</div>
</div> <!--product-list end-->
</div>
</div>

Sorry, for dirty code...
img {
display: block;
background-color: #fff;
transition: .2s;
}
.nav-ul:hover img {
opacity: 0;
}
a {
color: inherit;
text-decoration: none;
outline: none;
}
.list-unstyled {
padding: 0;
margin: 0;
list-style: none;
}
* {
box-sizing: border-box;
}
.nav-li {
position: relative;
}
.nav .tim {
opacity: 0;
position: absolute;
left: 6px;
bottom: 0;
transition: .5s;
}
.nav:hover .tim {
opacity: 1;
}
.nav .nav-ul {
padding: 0;
margin: 0;
list-style: none;
text-align: center;
}
.nav .nav-li {
display: inline-block;
font-size: 1em;
}
.nav .nav-li a {
position: relative;
display: block;
margin: 0 2px;
text-transform: uppercase;
overflow: hidden;
}
.nav .nav-li a:before {
box-sizing: border-box;
transform: translateX(100%);
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 2px;
border-bottom: 2px solid transparent;
border-left: 2px solid transparent;
}
.nav .nav-li a:after {
box-sizing: border-box;
transform: translateX(-100%);
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 2px;
border-top: 2px solid transparent;
border-right: 2px solid transparent;
}
.nav .nav-li a:hover {
color: inherit;
text-decoration: none;
}
.nav .nav-li a:hover:before {
transition: .2s transform linear, .2s height linear .2s;
transform: translateX(0);
height: 100%;
border-color: #1fbfac;
}
.nav .nav-li a:hover:after {
transition: .2s transform linear .4s, .2s height linear .6s;
transform: translateX(0);
height: 100%;
border-color: #1fbfac;
}
<div class="nav">
<div class="nav-ul">
<div class="nav-li">
<span class="tim">Kube house</span>
<a href="#">
<img src="http://beerhold.it/300/300">
</a>
</div>
</div>
<div class="nav-ul">
<div class="nav-li">
<span class="tim">Kube house</span>
<a href="#">
<img src="http://beerhold.it/300/300">
</a>
</div>
</div>
<div class="nav-ul">
<div class="nav-li">
<span class="tim">Kube house</span>
<a href="#">
<img src="http://beerhold.it/300/300">
</a>
</div>
</div>
</div>

To copy this effect you can inspect the element .no-touch .product-list .item a:hover on aforementioned site. There are span.title inside, and opacity for this element is changed from 0 to 1 on parent hovering. I can provide codepen for this, but after inspecting requested effect you will see that it is pretty self-explanatory.
For example:
.feature {
height:250px;
width:250px;
background:url('http://placehold.it/250x250');
position:relative;
}
.feature:hover {
background:red;
}
.feature:hover .title {
opacity: 1;
}
.title {
width:100%;
text-align:center;
position:absolute;
top:50%;
left:50%;
transform:translate(-50%, -50%);
display:block;
opacity:0;
}
<div class="feature">
<div class="title">Example Title</div>
</div>

Try this. It may help you.
HTML
<ul class="demo-3">
<li>
<figure>
<img src="https://lh6.ggpht.com/0d53JZiYmsBBhHv07OUeovHruEg0WvFdbhmy4iK1hyEifm6qV5dcEopPwq-Dz8eBWsxP=h900" alt="" width="100%"/>
<figcaption>
<h2>This is a cool title!</h2>
<p>A fish is any member of a paraphyletic group of organisms that consist of all gill-bearing aquatic craniate animals that lack limbs with digits.</p>
</figcaption>
</figure>
</li>
</ul>
CSS:
.demo-3 {
position:relative;
width:300px;
height:200px;
overflow:hidden;
float:left;
margin-right:20px
}
.demo-3 figure {
margin:0;
padding:0;
position:relative;
cursor:pointer;
margin-left:-50px
}
.demo-3 figure img {
display:block;
position:relative;
z-index:10;
margin:-15px 0
}
.demo-3 figure figcaption {
display:block;
position:absolute;
z-index:5;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box
}
.demo-3 figure h2 {
font-family:'Lato';
color:#fff;
font-size:20px;
text-align:left
}
.demo-3 figure p {
display:block;
font-family:'Lato';
font-size:12px;
line-height:18px;
margin:0;
color:#fff;
text-align:left
}
.demo-3 figure figcaption {
top:0;
left:0;
width:100%;
height:100%;
padding:29px 44px;
background-color:rgba(26,76,110,0.5);
text-align:center;
backface-visibility:hidden;
-webkit-transform:rotateY(-180deg);
-moz-transform:rotateY(-180deg);
transform:rotateY(-180deg);
-webkit-transition:all .5s;
-moz-transition:all .5s;
transition:all .5s
}
.demo-3 figure img {
backface-visibility:hidden;
-webkit-transition:all .5s;
-moz-transition:all .5s;
transition:all .5s
}
.demo-3 figure:hover img,figure.hover img {
-webkit-transform:rotateY(180deg);
-moz-transform:rotateY(180deg);
transform:rotateY(180deg)
}
.demo-3 figure:hover figcaption,figure.hover figcaption {
-webkit-transform:rotateY(0);
-moz-transform:rotateY(0);
transform:rotateY(0)
}
Run Code

Related

How can I overlap an image with text, but both of them are inside the same anchor tag?

I'm kind of new to css and html, never touched JS or jquery.
I'm building as practice a website that looks like somewhat a portfolio site where I have some photos that are clickable. One thing that I wanted to do is, when a user hovers an image, an opaque box would pop up from the photo's bottom showing some text, the problem is that I want this text to be clickable as well so I put it inside the same anchor tag, but they don't overlap instead the clickable area stretches and the text gets positioned to the side of the image.
Is there a way of doing it so the "clickable area" doesn't stretch and the text overlap the image but without using the image as a background ?
Here's what I'm trying to achieve https://theme-frsch2.tumblr.com/ .
I've tried wrapping the text in a div and moving the text so it would overlap the image but the problem is that the "clickable" area would still be stretched anyway.
And this is what I got so far.
HTML
#allimg{
display: flex;
flex-wrap: wrap;
justify-content: center;
}
#allimg a{
margin: 10px;
border: 2px solid red;
}
#allimg img{
transition: 0.1s ease;
box-shadow: 5px 5px 10px #888888;
float: left;
border: 1px solid pink;
}
#allimg img:hover{
transform: scale(1.02);
}
#allimg a p{
color: black;
position: relative;
bottom: 20px;
left: 0;
text-align: center;
}
<div id="allimg">
<a href="link1">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text1
</p>
</a>
<a href="link2">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text2
</p>
</a>
<a href="link3">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text3
</p>
</a>
<a href="link4">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text4
</p>
</a>
</div>
Here is jsfiddel link
If you want to overlap text inside an image and achieve that hover effect on the website you attached
you have to use position: absolute for your text
and set the position for your anchor tag to relative
make it hideen by setting visibility property to hidden and opacity
to 0
then on anchor tag hover, you set it back visible and 1 opacity
#allimg{
display: flex;
flex-wrap: wrap;
justify-content: center;
}
#allimg a{
margin: 10px;
border: 2px solid red;
position: relative;
}
#allimg img{
transition: 0.1s ease;
box-shadow: 5px 5px 10px #888888;
float: left;
border: 1px solid pink;
}
#allimg img:hover{
transform: scale(1.02);
}
#allimg a p{
color: black;
position: absolute;
bottom: 0;
left: 0;
margin: 0;
text-align: center;
width: 100%;
padding: 10px 0;
background: rgba(255,255,255,.5);
visibility: hidden;
opacity: 0;
transition: .2s ease-in-out;
}
#allimg a:hover p{
visibility: visible;
opacity: 1
}
<div id="allimg">
<a href="link1">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text1
</p>
</a>
<a href="link2">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text2
</p>
</a>
<a href="link3">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text3
</p>
</a>
<a href="link4">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text4
</p>
</a>
</div>
Put the image in parent container and text in child container, then in css file add 'position:relative' to the parent container and add 'position:absolute' to the child container.
This will overlap text and image.
Somewhat like this:
HTML Part:
<div class="parent">
<img src="https://via.placeholder.com/150" alt="image">
<div class="child">
<p>Text goes here</p>
</div>
</div>
CSS Part:
.parent
{
position:relative;
text-align:center;
}
.child
{
position:absolute;
top:0px;
left:0px;
}
This will overlap text on image and you make changes as you want in the position of the text.
Here's my solution with smooth transition.
#allimg{
display: flex;
flex-wrap: wrap;
justify-content: center;
}
#allimg a{
position: relative;
margin: 10px;
border: 2px solid red;
box-sizing: border-box;
transition: all 0.3s ease;
}
#allimg img{
position: abosolute;
vertical-align: bottom;
transition: 0.1s ease;
box-shadow: 5px 5px 10px #888888;
border: 1px solid pink;
transition: all 0.3s ease;
}
#allimg img:hover{
transform: scale(1.02);
}
#allimg a p{
margin: 0;
padding: 5% 0;
width: 100%;
color: black;
background-color: #fff;
box-sizing: border-box;
position: absolute;
text-align: center;
bottom: 0;
left: 0;
opacity: 0;
transition: all 0.3s ease;
}
#allimg a:hover{
transform: scale(1.1);
transition: all 0.3s ease;
}
#allimg a:hover p{
opacity: 1;
transition: all 0.6s ease;
}
<div id="allimg">
<a href="link1">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text1
</p>
</a>
<a href="link2">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text2
</p>
</a>
<a href="link3">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text3
</p>
</a>
<a href="link4">
<img src="https://via.placeholder.com/150" alt="">
<p>
Text4
</p>
</a>
</div>

Why are my table rows not aligning properly?

I'm making my first website and I ran into some problems with tables and the background. Here's a screen pic I took with my phone.If I preview this on my computer screen it look's a bit better because I don't have the background problem but anyway I can't figure out what is wrong with tables (specifically the 4th pic) and is my background not responsive. Btw all the picture are the same size....
HTML
<html>
<body>
<head>
<meta charset="utf-8">
<title>Projects</title>
<link href="css2.css" rel="stylesheet" type="text/css">
</head>
<head>
<div class="logo" >
<img src="lg.png" alt="" width="180" height="178" class="logo"/>
</div>
<meta charset="utf-8">
<title>mt</title>
</head>
<body>
<nav>
<ul>
<li>PROJECTS</li>
<li>ABOUT</li>
<li>CONTACT</li>
</ul>
</nav>
<div class="box" >
<div class="table" >
<table width="900" height="200" border="0" cellspacing="7" cellpadding="9">
<tbody>
<tr>
<td>
<div class="row" >
<li>
<a href="project1.html">
<div class="raste">
<img src="logos.jpg" alt="" width="300"/>
</div>
</a>
</li>
</div>
</td>
<td>
<li>
<a href="project2.html">
<div class="raste">
<img src="elite.jpg" alt="" width="300"/>
</div>
</a>
</li>
</td>
<td>
<li>
<a href="project3.html">
<div class="raste">
<img src="time.jpg" alt="" width="300"/>
</div>
</a>
</li>
</td>
</tr>
<tr>
<td>
<li>
<a href="project4.html">
<div class="raste">
<img src="booksrie.jpg" alt="" width="300"/>
</div>
</a>
</li>
</td>
<td>
<li>
<a href="project5.html">
<div class="raste">
<img src="log.jpg" alt="" width="300"/>
</div>
</a>
</li>
</td>
<td>
<li>
<a href="project6.html">
<div class="raste">
<img src="log.jpg" alt="" width="300"/>
</div>
</a>
</li>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</body>
</html>
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;
}
li {
display: inline;
color: #000000;
}
a {
text-decoration: none;
color: black;
}
a:hover {
color: lightgray;
}
a:active {
color: black;
}
body {
background-color: #F6F6F6;
}
table {
margin-left: auto;
margin-right: auto;
}
.raste img {
height: 190px;
width: 300px;
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
transition: all 0.5s ease;
display: block;
border: none;
border-radius: 10px;
}
.raste img:hover {
-webkit-transform: scale(1.079);
transform: scale(1.079);
}
.table {
display: table;
margin: 1em auto;
}
.row {
display: table-row;
}
.raste {
display: table-cell;
}
#font-face {
font-family: Proxima;
src: url(Fonts/Proxima_Regular.otf);
}
ul {
padding: 0;
}
.box {
background:#000000;
width: 100%;
background-size: 0% auto;
margin-bottom: 5%;
border-radius: 10px;
padding-bottom: 1%;
padding-top: 1%;
}
Use bootstrap grid example fiddle
HTML
<div class="main pull-left">
<div class="col-sm-6 col-md-4 box">1</div>
<div class="col-sm-6 col-md-4 box">2</div>
<div class="col-sm-6 col-md-4 box">3</div>
<div class="col-sm-6 col-md-4 box">4</div>
<div class="col-sm-6 col-md-4 box">5</div>
<div class="col-sm-6 col-md-4 box">6</div>
</div>
CSS
body{padding:0px; margin:0px;}
.main{width:100%; background:#000; border-radius:10px; padding:10px;}
.main .box{background:#fff; color:#000; border:solid 4px #000; padding:20px 0px; text-align:center;}
You can clean up your html deleting all tags useless , so it is easier to style, to maintain and to validate.
example :
#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 {
content: url(http://lorempixel.com/100/100/people/6);
border-radius: 50%;
overflow: hidden;
}
nav:before,
.table {
display: table;
margin: auto;
max-width: 1040px;
}
a {
text-decoration: none;
color: black;
}
a:hover {
color: lightgray;
}
a:active {
color: black;
}
body {
background-color: #F6F6F6;
}
.raste img {
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
-ms-transition: all 0.5s ease;
transition: all 0.5s ease;
display: block;
border: none;
border-radius: 10px;
}
.raste img:hover {
-webkit-transform: scale(1.079);
transform: scale(1.079);
}
.box {
display: inline-flex;
flex-wrap: wrap;
justify-content:center;
}
.raste {
padding: 15px;
}
#font-face {
font-family: Proxima;
src: url(Fonts/Proxima_Regular.otf);
}
ul {
padding: 0;
}
.box {
background: #000000;
background-size: 0% auto;
margin-bottom: 5%;
border-radius: 10px;
padding: 16px;
}
<nav> PROJECTS ABOUT CONTACT
</nav>
<div class="table">
<div class="box">
<a href="project1.html">
<div class="raste">
<img src="http://dummyimage.com/300x190/456&text=logo.jpg" alt="" />
</div>
</a>
<a href="project2.html">
<div class="raste">
<img src="http://dummyimage.com/300x190/55f&text=elite.jpg" alt="" width="300" />
</div>
</a>
<a href="project3.html">
<div class="raste">
<img src="http://dummyimage.com/300x190/fed&text=time.jpg" alt="" width="300" />
</div>
</a>
<a href="project4.html">
<div class="raste">
<img src="http://dummyimage.com/300x190/bad&text=booksrie.jpg" alt="" width="300" />
</div>
</a>
<a href="project5.html">
<div class="raste">
<img src="http://dummyimage.com/300x190/a55&text=log.jpg" alt="" width="300" />
</div>
</a>
<a href="project6.html">
<div class="raste">
<img src="http://dummyimage.com/300x190/ef0&text=log.jpg" alt="" width="300" />
</div>
</a>
</div>
</div>

how do you do this rollover state using CSS

http://www.habib-fadel.com/en/artwork/
Please could someone tell me how to do this hover state.
This is my HTML at the moment:
<div class="grid-item">
<a href="#">
<div class="details">
<div class="title">Portrait VII</div>
<div class="icon-cross icon"></div>
</div>
</a>
<img src="images/1.jpg">
</div>
HTML
<div class="grid-item">
<a href="#" class="hoverItem">
<div class="details">
<div class="title">Portrait VII</div>
<div class="icon-cross icon"></div>
</div>
</a>
<img src="http://www.habib-fadel.com/data/oeuvres_2716d/fiche/62/vign_kaa_1528_4cf8a.jpg">
</div>
CSS
.grid-item {
width:200px;
position:relative;
}
.grid-item:hover a{
transform: scale(1);
}
.grid-item img {
width:100%;
}
.grid-item a {
display:block;
background-color:red;
top:0px;
position:absolute;
width:200px;
height:100%;
transform: scale(0);
transition:0.2s linear all;
}
.grid-item .title {
text-align: center;
width: 100%;
display: block;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
http://jsfiddle.net/ort52qzd/2/

I want to merge two cells together in the proposed html layout

I'm using this layout and as you can see there is a section with 8 pictures on the bottom of the page - each of them is a hyperlink to the bigger image. It works pretty neat, esp. when you resize the page to smaller size, then the 4 cells becomes 2 and it looks like this. I want to change it a little, so that two first pictures are merged together, so the layout could look like this, and when the user resizes it, it would show him a proper layout like this. So far the html code for that specific part of the page looks like this:
<section class="screenshots" id="screenshots">
<div class="container-fluid">
<div class="row">
<ul class="grid">
<li>
<figure>
<img src="img/02-screenshot.jpg" alt="Screenshot 01">
<figcaption>
<div class="caption-content">
<a href="img/large/02.jpg" class="single_image">
<i class="fa fa-search"></i><br>
<p>User Centric Design</p>
</a>
</div>
</figcaption>
</figure>
</li>
<li>
<figure>
<img src="img/03-screenshot.jpg" alt="Screenshot 01">
<figcaption>
<div class="caption-content">
<a href="img/large/03.jpg" class="single_image">
<i class="fa fa-search"></i><br>
<p>Responsive and Adaptive</p>
</a>
</div>
</figcaption>
</figure>
</li>
<li>
<figure>
<img src="img/04-screenshot.jpg" alt="Screenshot 01">
<figcaption>
<div class="caption-content">
<a href="img/large/04.jpg" class="single_image">
<i class="fa fa-search"></i><br>
<p>Absolutely Free</p>
</a>
</div>
</figcaption>
</figure>
</li>
</ul>
</div>
<div class="row">
<ul class="grid">
<li>
<figure>
<img src="img/06-screenshot.jpg" alt="Screenshot 01">
<figcaption>
<div class="caption-content">
<a href="img/large/06.jpg" class="single_image">
<i class="fa fa-search"></i><br>
<p>Exclusive to Codrops</p>
</a>
</div>
</figcaption>
</figure>
</li>
<li>
<figure>
<img src="img/07-screenshot.jpg" alt="Screenshot 01">
<figcaption>
<div class="caption-content">
<a href="img/large/07.jpg" class="single_image">
<i class="fa fa-search"></i><br>
<p>Made with Love</p>
</a>
</div>
</figcaption>
</figure>
</li>
<li>
<figure>
<img src="img/08-screenshot.jpg" alt="Screenshot 01">
<figcaption>
<div class="caption-content">
<a href="img/large/08.jpg" class="single_image">
<i class="fa fa-search"></i><br>
<p>In Sydney, Australia</p>
</a>
</div>
</figcaption>
</figure>
</li>
</ul>
</div>
</div>
</section>
and the css code looks like this:
/* ==========================================================================
Screenshots Intro
========================================================================== */
.screenshots-intro {
padding: 170px 0 100px 0;
background-color: #f6f7f9;
}
.screenshots-intro h1 {
margin-bottom: 20px;
color: #24374b;
font-weight: 400;
font-size: 22px;
}
.screenshots-intro p {
margin-bottom: 25px;
color: #778899;
}
/* ==========================================================================
Screenshots
========================================================================== */
.screenshots ul {
margin: 0;
padding: 0;
width: 100%;
}
.screenshots ul li {
float: left;
min-height: 100%;
width: 25%;
background-color: #000;
list-style: none;
}
.screenshots figure {
position: relative;
overflow: hidden;
}
.screenshots figure img {
width: 100%;
height: 100%;
-webkit-transition: all 300ms ease-in-out;
transition: all 300ms ease-in-out;
}
.screenshots figure:hover img, .screenshots figure:focus img {
-webkit-transform: scale(1.1);
-ms-transform: scale(1.1);
transform: scale(1.1);
}
.screenshots figcaption {
position: absolute;
top: 0;
left: 0;
padding: 25% 0;
width: 100%;
height: 100%;
background-color: rgba(63, 97, 132, 0.85);
text-align: center;
font-size: 15px;
opacity: 0;
-webkit-transition: all 300ms ease-in-out;
transition: all 300ms ease-in-out;
}
.screenshots figcaption a {
color: #fff
}
.screenshots figcaption a:hover, .screenshots figcaption a:focus {
color: #73d0da
}
.screenshots figure:hover figcaption, .screenshots figure:focus figcaption {
opacity: 1
}
.visible {
opacity: 1
}
.screenshots figure.cs-hover figcaption {
opacity: 1
}
.screenshots figcaption i {
font-size: 35px
}
.screenshots figcaption p {
margin-bottom: 0;
text-transform: uppercase;
font-weight: 400;
}
.screenshots figcaption .caption-content {
position: absolute;
top: 50%;
left: 50%;
margin-top: -40px;
margin-left: -100px;
width: 200px;
-webkit-transform: translate(0px, 15px);
-ms-transform: translate(0px, 15px);
transform: translate(0px, 15px);
-webkit-transition: all 300ms ease-in-out;
transition: all 300ms ease-in-out;
}
.screenshots figure:hover figcaption .caption-content, .screenshots figure:focus figcaption .caption-content {
-webkit-transform: translate(0px, 0px);
-ms-transform: translate(0px, 0px);
transform: translate(0px, 0px);
}
I know it's a lot of code, but maybe anyone of you have the idea of how to change this particular part of the layout to have it as I included in the pictures? Thanks.
This is the updated answer.
I am attaching the code and jsfiddle link with it.
Just replace the src of the images with yours to see the results.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<style type="text/css">
.container {
width: 100%;
margin: 0 auto;
}
img {
max-width: 100%;
}
/* this css is just for understanding */
.a {
background-color: red;
}
.b {
background-color: green;
}
.c {
background-color: blue;
}
.d {
background-color: black;
}
/* this css is just for understanding */
/* this is the logic to change the positions of image */
#media (min-width: 320px) {
.a,
.b,
.c,
.d {
width: 100%;
float: left;
}
}
#media (min-width: 768px) {
.a,
.b,
.c,
.d {
width: 50%;
float: left;
}
}
</style>
<body>
<div class="container">
<div class="a">
<img src="img/1.png" height="222" width="581">
</div>
<div class="b">
<img src="img/2.jpg" height="222" width="581">
</div>
<div class="c">
<img src="img/3.jpg" height="222" width="581">
</div>
<div class="d">
<img src="img/4.png" height="222" width="581">
</div>
</div>
</body>
</html>
this is the jsfiddle link

need help in the following html code to make it a flexislider with scrolling 4 images at a time

I need Help guys in making the following code to behave like a flexislider, I have following code which shows 4 images in a row., but i want to add animation o next and previous arrows to it so it should navigate 4 at a time,
I am little lost here please guide
The Following is the HTML
<section id="related" class="row">
<div class="container">
<h1 class="heading1"><span class="maintext">Related Products</span><span class="subtext"> See Our Most featured Products</span></h1>
<ul class="thumbnails">
<li class="span3">
<a class="prdocutname" href="product.html">Product Name Here</a>
<div class="thumbnail">
<span class="sale tooltip-test">Sale</span>
<img alt="" src="img/product1.jpg">
<div class="shortlinks">
<a class="details" href="#">DETAILS</a>
<a class="wishlist" href="#">WISHLIST</a>
<a class="compare" href="#">COMPARE</a>
</div>
<div class="pricetag">
<span class="spiral"></span>ADD TO CART
<div class="price">
<div class="pricenew">$4459.00</div>
<div class="priceold">$5000.00</div>
</div>
</div>
</div>
</li>
<li class="span3">
<a class="prdocutname" href="product.html">Product Name Here</a>
<div class="thumbnail">
<img alt="" src="img/product2.jpg">
<div class="shortlinks">
<a class="details" href="#">DETAILS</a>
<a class="wishlist" href="#">WISHLIST</a>
<a class="compare" href="#">COMPARE</a>
</div>
<div class="pricetag">
<span class="spiral"></span>ADD TO CART
<div class="price">
<div class="pricenew">$4459.00</div>
<div class="priceold">$5000.00</div>
</div>
</div>
</div>
</li>
<li class="span3">
<a class="prdocutname" href="product.html">Product Name Here</a>
<div class="thumbnail">
<span class="offer tooltip-test" >Offer</span>
<img alt="" src="img/product1.jpg">
<div class="shortlinks">
<a class="details" href="#">DETAILS</a>
<a class="wishlist" href="#">WISHLIST</a>
<a class="compare" href="#">COMPARE</a>
</div>
<div class="pricetag">
<span class="spiral"></span>ADD TO CART
<div class="price">
<div class="pricenew">$4459.00</div>
<div class="priceold">$5000.00</div>
</div>
</div>
</div>
</li>
<li class="span3">
<a class="prdocutname" href="product.html">Product Name Here</a>
<div class="thumbnail">
<img alt="" src="img/product2.jpg">
<div class="shortlinks">
<a class="details" href="#">DETAILS</a>
<a class="wishlist" href="#">WISHLIST</a>
<a class="compare" href="#">COMPARE</a>
</div>
<div class="pricetag">
<span class="spiral"></span>ADD TO CART
<div class="price">
<div class="pricenew">$4459.00</div>
<div class="priceold">$5000.00</div>
</div>
</div>
</div>
</li>
</ul>
</div>
the following CSS
#related .thumbnails li:hover .thumbnail img, #category .thumbnails li:hover .thumbnail img, .thumbnails.list li:hover .thumbnail img { transform: scale(1.2, 1.2); -ms-transform: scale(1.2, 1.2); /* IE 9 */ -webkit-transform: scale(1.2, 1.2); /* Safari and Chrome */ -o-transform: scale(1.2, 1.2); /* Opera */ -moz-transform: scale(1.2, 1.2); /* Firefox */ transition: all 0.8s; -ms-transition: all 0.8s; /* IE 9 */ -moz-transition: all 0.8s; /* Firefox 4 */ -webkit-transition: all 0.8s; /* Safari and Chrome */ -o-transition: all 0.8s; /* Opera */ }
.container:after {clear: both;
visibility: hidden;
display: block;
content: "";
clear: both;
height: 0;;}
.thumbnails .prdocutname { font-size:16px; color:#5e626b; text-transform:uppercase; text-align:center; margin:0 0 10px 0; display:block }
.thumbnails.list .thumbnail .prdocutname { font-size:16px; color:#5e626b; text-transform:uppercase; text-align:left; margin:0 0 10px 0; display:block }
.thumbnails.list > li { margin-bottom:40px; padding-bottom:40px; border-bottom:1px solid #ccc }
.thumbnails.list .productdiscrption { margin:10px 0 25px 0 }
.thumbnails.list .thumbnail .shortlinks { display:block; width:auto; position:static; text-align:left; margin:10px 0 25px 0 }
.thumbnails.list .pricetag { margin-left:-15px }
.thumbnail .offer { position:absolute; top:10px; left:-2px; background:url(../img/offer.png) no-repeat 0 0; height:45px; width:68px; float:left; overflow:hidden; display:block; text-indent:9999px }
.thumbnail .sale { position:absolute; top:10px; left:-2px; background:url(../img/sale.png) no-repeat 0 0; height:45px; width:68px; float:left; overflow:visible; display:block; text-indent:9999px;z-index:9999; cursor:pointer; }
.thumbnail .new { position:absolute; top:10px; left:-2px; background:url(../img/new.png) no-repeat 0 0; height:45px; width:68px; float:left; overflow:hidden; display:block; text-indent:9999px }
.thumbnail .pricetag { width:221px; height:37px; background:url(../img/pricetag.png) no-repeat right 0; margin-top:8px; position:relative; padding:9px 9px 9px 40px; margin-bottom:20px }
.thumbnail .pricetag .spiral { position:absolute; top:-19px; left:10px; background:url(../img/spiral.png) no-repeat right 0; height:50px; width:35px }
.thumbnail a.productcart { background: #f25c27 url(../img/prodcutcart.png) right 7px no-repeat; color:#fff; float:right; padding:8px 27px 8px 8px; font-size:13px; }
.thumbnail a.productcart:hover { background: #db420e url(../img/prodcutcart.png) right 7px no-repeat; }
.thumbnail input.productcart_btn { border:none; background: #f25c27 url(../img/prodcutcart.png) right 7px no-repeat; color:#fff; float:right; padding:8px 27px 8px 8px; font-size:13px; }
.thumbnail input.productcart_btn:hover { border:none; background: #db420e url(../img/prodcutcart.png) right 7px no-repeat; }
.thumbnail .shortlinks { background:#fff; position:absolute; left:0; top:60%; width:100%; text-align:center; padding:5px 0; display:none }
.thumbnail .shortlinks a { font-size:12px; padding:5px 5px 0 25px; background:url(../img/sprite.png) 0 0 no-repeat; }
.thumbnail .shortlinks a.details { background-position:0 -384px }
.thumbnail .shortlinks a.wishlist { background-position:0 -423px }
.thumbnail .shortlinks a.compare { background-position:0 -462px }
.thumbnail .shortlinks a.csale { background-position:0 -462px }
.thumbnail .price { float:right; margin-right:19px; text-align:right }
.thumbnail .price .pricenew { font-size:16px; color:#5e626b; font-weight:bold }
.thumbnail .price .priceold { font-size:13px; color:#5e626b; text-decoration:line-through; color:#96979d; }
Do you mean something like cycle : http://jquery.malsup.com/cycle/
or carouFredSel http://caroufredsel.dev7studios.com/
for cycle there are various options but basically you have a container which contains objects
<div class="container">
<div class="object">Html for 4 things</div>
<div class="object">Html for 4 things</div>
etc...
</div>
then you call cycle on the container
$(function(){
$('.continer').cycle();
});
this will now cycle between the objects.
carouFredSel works in a similar way and can divide your objects up for you. i would have a look at the homepage for some examples.
Both require jquery http://jquery.com/ to work.