HTML CSS Overflow on hover without changing positions - html

Can anyone kindly help me out with my css+html issue? Please refer the code snippet I have added.
What I need to achive,
1. The boxes(.box) with images to stay fixed
2. The hidden description (.hidden) to go over the below image box when hovered without moving it
Can someone please help me figuring this out?
.box {
width: 170px;
transition: all .4s ease;
border-bottom: 10px solid #fff;
color:#000 !important;
}
#caption {
width: 160px;
font-size:15px;
text-decoration:none;
margin: 0 0 0px 5px;
}
.boximg{
width: auto;
max-width: 100%;
margin-bottom: 8px;
}
.box:hover {
width: auto;
max-width: 170px;
border-bottom: 10px solid #000;
transition: all .4s ease;
color:#ccdc29 !important;
background-color:#000;
}
.box:hover > #hidden {
display:block;
transition: all .3s ease;
overflow-x: hidden;
}
#hidden {
display:none;
color:#fff;
margin:5px;
transition: all .3s ease;
}
.image_off, #home:hover .image_on{
display:none;
transition: all .4s ease;
}
.image_on, #home:hover .image_off{
display:block;
transition: all .4s ease;
}
<div class="box">
<a href="#">
<img width="170px" class="image_on" src="http://kittenrescue.org/wp-content/uploads/2017/03/KittenRescue_KittenCareHandbook.jpg" /><img width="170px" class="image_off" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSH5rO0Te6nVxuBwuR352PJIKb6MeV-PDBKnVm4DBpwvd-8DPAJ" />
<br>
</a>
<p id="caption">Lorem Ipsum</p>
<p id="hidden">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin condimentum, nisi vel cursus consectetur, 7</p>
</div>
<div class="box">
<a href="#">
<img width="170px" class="image_on" src="http://kittenrescue.org/wp-content/uploads/2017/03/KittenRescue_KittenCareHandbook.jpg" /><img width="170px" class="image_off" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSH5rO0Te6nVxuBwuR352PJIKb6MeV-PDBKnVm4DBpwvd-8DPAJ" />
<br>
</a>
<p id="caption">Lorem Ipsum</p>
<p id="hidden">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin condimentum, nisi vel cursus consectetur</p>
</div>
Thanks heaps!

Try the following. I have fixed your nested anchors, removed some duplicate ids and positioned the caption absolutely. The only thing I would say is the caption has an 18px minus margin - not sure what creates that gap for the margin to be needed
Also if you want to stop the blinking effect, you need to use the same size images - your hover one is slightly larger
.box {
width: 170px;
transition: all .4s ease;
color: #000 !important;
position:relative;
padding:0;
margin-bottom:10px;
}
.box > a
.box span,
.box img {
display:block;
}
#caption {
width: 160px;
font-size: 15px;
text-decoration: none;
margin: 0 0 0px 5px;
}
.boximg {
width: auto;
max-width: 100%;
}
.box:hover {
width: auto;
max-width: 170px;
transition: all .4s ease;
color: #ccdc29 !important;
z-index:2;
}
.box:hover>#caption {
display:none;
}
.box:hover>#hidden {
display: block;
transition: all .3s ease;
background-color: #000;
}
#hidden {
display: none;
color: #fff;
transition: all .3s ease;
position:absolute;
left:0;
right:0;
top:100%;
padding:5px;
margin:-18px 0 0 0;
}
.box .image_off,
#home:hover .image_on {
display: none;
transition: all .4s ease;
}
.box .image_on,
#home:hover .image_off {
display: block;
transition: all .4s ease;
}
<div class="box">
<a href="#">
<span class="boximg" id="home"><img width="170px" class="image_on" src="http://kittenrescue.org/wp-content/uploads/2017/03/KittenRescue_KittenCareHandbook.jpg" /><img width="170px" class="image_off" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSH5rO0Te6nVxuBwuR352PJIKb6MeV-PDBKnVm4DBpwvd-8DPAJ"
/></span>
<br>
</a>
<p id="caption">Lorem Ipsum</p>
<p id="hidden">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin condimentum, nisi vel cursus consectetur, 7</p>
</div>
<div class="box">
<a href="#">
<span class="boximg" id="home1"><img width="170px" class="image_on" src="http://kittenrescue.org/wp-content/uploads/2017/03/KittenRescue_KittenCareHandbook.jpg" /><img width="170px" class="image_off" src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSH5rO0Te6nVxuBwuR352PJIKb6MeV-PDBKnVm4DBpwvd-8DPAJ"
/></span>
<br>
</a>
<p id="caption">Lorem Ipsum</p>
<p id="hidden">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin condimentum, nisi vel cursus consectetur</p>
</div>

.img-with-text{
position: relative;
width: 170px;
}
.img-with-text > div{
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0, 0, 0, 0);
color: transparent;
transition: 1s;
}
.img-with-text > div:hover{
background-color: rgba(0, 0, 0, 0.6);
color: white;
}
<div class="img-with-text">
<img src="http://kittenrescue.org/wp-content/uploads/2017/03/KittenRescue_KittenCareHandbook.jpg" alt="image" width="170">
<div><h2>Hello!</h2></div>
</div>
<div class="img-with-text">
<img src="http://kittenrescue.org/wp-content/uploads/2017/03/KittenRescue_KittenCareHandbook.jpg" alt="image" width="170">
<div><h2>Hello!</h2></div>
</div>

Related

Text on <img> using CSS

I want to display text at the center of my 4 images. No matter what I do it doesn't display at all or display on the top of the page.
Somebody, please help me!
By the way, does anybody know how to make banner-text always stay the same (the same as at 100%) when zooming?
UPD: https://jsfiddle.net/5no1pjt2/4/
/* quick reset */
* {
margin: 0;
padding: 0;
border: 0;
}
#banner {
position: relative;
width: 100%;
}
#banner img {
width: 100%;
height: 100%;
float: left; /* no line after <img> */
}
#banner-text {
position: absolute;
margin: 250px 120px;
font-size: 42px;
color: #ffffff;
/* background: rgba(0, 0, 0, 0.5); */
}
#banner-text p {
width: 800px;
/* font-family: Palanquin Regular; */
font-size: 24px;
line-height: 24px;
}
#img__wrap img {
width: 50%;
height: auto;
/* display: inline-block; */
float: left; /* no line after <img> */
/* transition */
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
#img__wrap img:hover {
/* filters for animation */
-webkit-filter: brightness(70%);
-moz-filter: brightness(70%);
-o-filter: brightness(70%);
-ms-filter: brightness(70%);
filter: brightness(70%);
}
/* relevant styles */
#img__wrap {
position: relative;
}
.img__description {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(29, 106, 154, 0.72);
color: #fff;
visibility: visible;
opacity: 0;
}
#img__wrap:hover .img__description {
visibility: visible;
opacity: 1;
}
<div id="banner">
<img src="http://placehold.it/1920x1080"/>
<div id="banner-text">
<h1>Lorem ipsum dolor sit amet</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur quis ultrices tellus, at vulputate risus.Cras convallis molestie libero, ac fringilla lacus lobortis ut.
</p>
</div>
</div>
<div id="img__wrap">
<img class="img__img" src="http://placehold.it/952x512"/>
<p class="img__description">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<img class="img__img" src="http://placehold.it/952x512"/>
<p class="img__description">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<img class="img__img" src="http://placehold.it/952x512"/>
<p class="img__description">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<img class="img__img" src="http://placehold.it/952x512"/>
<p class="img__description">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
The key is to create a wrapper to hold your image and text. Then add position relative to that wrapper. And then to the text inside it, add top 50% and then lift it half of its height by adding transform translateY(-50%).
If you want the same for X axis, use left 50% and translateX(-50%).
/* quick reset */
* {
margin: 0;
padding: 0;
border: 0;
}
#banner {
position: relative;
width: 100%;
}
#banner img {
width: 100%;
height: 100%;
float: left; /* no line after <img> */
}
#banner-text {
position: absolute;
margin: 250px 120px;
font-size: 42px;
color: #ffffff;
/* background: rgba(0, 0, 0, 0.5); */
}
#banner-text p {
width: 800px;
/* font-family: Palanquin Regular; */
font-size: 24px;
line-height: 24px;
}
#img__wrap img {
width: 100%;
height: auto;
/* display: inline-block; */
float: left; /* no line after <img> */
/* transition */
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-o-transition: all 1s ease;
-ms-transition: all 1s ease;
transition: all 1s ease;
}
#img__wrap img:hover {
/* filters for animation */
-webkit-filter: brightness(70%);
-moz-filter: brightness(70%);
-o-filter: brightness(70%);
-ms-filter: brightness(70%);
filter: brightness(70%);
}
/* relevant styles */
.img__wrap {
position: relative;
height: 200px;
width: 257px;
}
.img__description {
position: absolute;
top: 50%;
bottom: 0;
left: 0;
right: 0;
background: rgba(29, 106, 154, 0.72);
color: #fff;
height: 40px;
transform: translateY(-50%);
text-align: center;
}
.img__wrap:hover .img__description {
visibility: visible;
opacity: 1;
}
.image-wrap {
position: relative;
width: 50%;
float: left;
}
<div id="banner">
<img src="http://placehold.it/1920x1080"/>
<div id="banner-text">
<h1>Lorem ipsum dolor sit amet</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur quis ultrices tellus, at vulputate risus.Cras convallis molestie libero, ac fringilla lacus lobortis ut.
</p>
</div>
</div>
<div id="img__wrap">
<div class="image-wrap">
<img class="img__img" src="http://placehold.it/952x512"/>
<p class="img__description">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="image-wrap">
<img class="img__img" src="http://placehold.it/952x512"/>
<p class="img__description">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="image-wrap">
<img class="img__img" src="http://placehold.it/952x512"/>
<p class="img__description">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
<div class="image-wrap">
<img class="img__img" src="http://placehold.it/952x512"/>
<p class="img__description">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
</div>
</div>
To make the banner text central in the banner you could try:
#banner-text {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
font-size: 42px;
color: #ffffff;
}
Its worth noting that the transform won't work on older versions of IE.
I want to display text at the center of my 4 images.
No matter what I do it doesn't display at all or display
on the top of the page.
You have two problems:
The "absolute" position declaration for the "img__description". The absolute position rule you have used on the text (<p class="img__description">...</p>) places all 4 texts in the upper left hand corner of the page. Declare a relative position for the text, and then give the text something to be relative to. (See next point).
Structure: No relation exists between each img and text pair There is currently no container or relationship tying any of the text elements (<p class="img__description">...</p>) to any of your 4 images: <img class="img__img" src="..." />.
It will be difficult to position the text relative to the appropriate image without a wrapper. Consider either:
moving the image inside each paragraph, and moving your positioning and sizing rules to the paragraph, which will act like a wrapper;
or add a <div> around each image and text pair, and subsequently move your positioning and sizing rules to the new <div> wrapper
Either of these wrapper options will also constrain the height and width of the text, which you also need.

CSS Animation slider

I am trying to do an animation slider using only CSS. I have 3 pictures that I want to slide horizontally. My question is that I can add them transformation, but no animation The animation has to stop for a few seconds on each image. Anyone has ideas how to manage it? I use sass.
Code:
.slider {
position: relative;
height: 100vh;
// width: 100vw;
overflow: hidden;
display: block;
.slides {
position: absolute;
top: 0;
left: 0;
overflow: hidden;
display: flex;
transition-timing-function: ease-out;
animation: slide 3s steps(2) infinite;
.slide {
height: 100vh;
width: 100vw;
padding: 100px;
margin: 0 auto;
float: left;
text-align: center;
img {
margin: 0 auto;
border-radius: 50%;
height: 250px;
}
h1 {
color: #323232;
font-size: 32px;
line-height: 42px;
letter-spacing: 1px;
padding-bottom: 12px;
}
h4 {
font-weight: 200;
line-height: 32px;
letter-spacing: 0.9px;
display: flex;
}
}
//end .slide
&:after {
content: "";
clear: both;
display: block;
}
}
//end .slides
#keyframes slide {
to {
transform: translateX(-300vw);
}
}
}
}
<section class="slider">
<div class="slides">
<div class="slide">
<img src="images/testimonial-img-1.jpg" alt="" />
<h1>TANYA - Architect</h1>
<h4>Lorem ipsum dolor sit amet, maecenas eget vestibulum justo imperdiet, wisi risus purus augue vulputate voluptate neque, curabitur dolor libero sodales vitae elit massa.</h4>
</div>
<div class="slide">
<img src="images/testimonial-img-2.jpg" alt="" />
<h1>LINDA - City planner</h1>
<h4>Lorem ipsum dolor sit amet, maecenas eget vestibulum justo imperdiet, wisi risus purus augue vulputate voluptate neque, curabitur dolor libero sodales vitae elit massa.</h4>
</div>
<div class="slide">
<img src="images/testimonial-img-3.jpg" alt="" />
<h1>SANDAR - Developer</h1>
<h4>Lorem ipsum dolor sit amet, maecenas eget vestibulum justo imperdiet, wisi risus purus augue vulputate voluptate neque, curabitur dolor libero sodales vitae elit massa.</h4>
</div>
</div>
</section>
Try this:-
#outerbox{
width:700px;
overflow:hidden;
}
#sliderbox{
position:relative;
width:2800px;
animation:animation 20s infinite;
}
#sliderbox img{
float:left;
}
#keyframes animation{
0%{
left:0px;
}
100%{
left:-2800px;
}
}
<div id="outerbox">
<div id="sliderbox">
<img src="http://labs.qnimate.com/slider/1.jpg"/>
<img src="http://labs.qnimate.com/slider/2.jpg"/>
<img src="http://labs.qnimate.com/slider/3.jpg"/>
Ok try this
#outerbox{
width:700px;
}
#sliderbox{
position:relative;
width:2800px;
animation:animation 20s infinite;
}
#sliderbox img{
float:left;
}
#keyframes animation{
0%{
left:0px;
}
20%{
left:0px;
}
25%{
left:-700px;
}
45%{
left:-700px;
}
50%{
left:-1400px;
}
70%{
left:-1400px;
}
}
<div id="outerbox">
<div id="sliderbox">
<img src="http://labs.qnimate.com/slider/1.jpg"/>
<img src="http://labs.qnimate.com/slider/2.jpg"/>
<img src="http://labs.qnimate.com/slider/3.jpg"/>
</div>
</div>
Your css, fixed:
.slider{
position: relative;
height: 100vh;
// width: 100vw;
overflow: hidden;
display: block;
}
.slides{
position: absolute;
top: 0;
left: 0;
overflow: hidden;
display: flex;
animation: slide 3s ease-out infinite;
}
.slide{
height: 100vh;
width: 100vw;
padding: 100px;
margin: 0 auto;
float: left;
text-align: center;
}
img{
margin: 0 auto;
border-radius: 50%;
height: 250px;
}
h1{
color: #323232;
font-size: 32px;
line-height: 42px;
letter-spacing: 1px;
padding-bottom: 12px;
}
h4{
font-weight: 200;
line-height: 32px;
letter-spacing: 0.9px;
display: flex;
}
&:after{
content: "";
clear: both;
display: block;
}
The closing } were wrong. you can't have a css rule inside another.
Also the transition timing wasn't doing anything if you are using animation, you can add it to the animation declaration. Transition and animation are two different things. Both have timing function which you can declare on a single line or separately.

CSS hover effect applying to everything but h4

I have the following scenario:
I'm using bootstrap to develop this site. When I hover into a list group, everything is suppose to have a trnasition into a blue background color and the text should go white. It works though the styles don't apply to the H4.
Here's the css code:
.styled-group-right-item{
padding: 20px;
margin-left: 100px;
}
.limited-list-group{
height: auto;
max-height: 500px;
overflow-y: scroll;
}
.author-pubdate-info{
font-weight: bold;
}
.list-group-item-switchhon-blog:hover{
transition: all 0.5s ease !important;
color: #fff !important;
background-color: #2980b9 !important;
}
.list-group-item-switchhon-blog{
transition: all 0.5s ease;
}
And here is the markup:
<div class="list-group limited-list-group">
<a href="#" class="list-group-item clearfix list-group-item-switchhon-blog">
<div class="pull-left">
<img src="http://placehold.it/100x100" class="btn-center">
</div>
<div class="styled-group-right-item">
<h4 class="list-group-item-heading">Lorem Ipsum Dolor Sit Amet</h4>
<p class="list-group-item-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget interdum libero. Vivamus pharetra faucibus.</p>
<span class="author-pubdate-info">Autor: John Doe | Fecha: 11 de Noviembre de 2014</span>
</div>
</a>
</div>
And here's a fiddle: http://jsfiddle.net/y7d5fm1w/
What I have tried so far: add another class like this:
.list-group-item-switchhon-blog:hover h4{
transition: all 0.5s ease !important;
color: #fff !important;
background-color: #2980b9 !important;
}
But that creates a very funny effect, try it on fiddle, it's not good.
Any ideas how to apply the styles into the h4, please I'm all ears.
Apply the style to the h4 as well. Also, place the transition on the non hover state; This ensures that the transition will apply in and out of the hover state.
Aside: If you change overflow-y: scroll to overflow-y: auto, you will only get a scrollbar if the content actually overflows.
Changes
.list-group-item-switchhon-blog, .list-group-item-switchhon-blog h4 { /* transition here */
transition: all 0.5s ease !important;
}
.list-group-item-switchhon-blog:hover {
color: #fff !important;
background-color: #2980b9 !important;
}
.list-group-item-switchhon-blog:hover h4 { /* add this */
color: #fff !important;
}
Working example
.styled-group-right-item {
padding: 20px;
margin-left: 100px;
}
.limited-list-group {
height: auto;
max-height: 500px;
overflow-y: auto;
}
.author-pubdate-info {
font-weight: bold !important;
}
.list-group-item-switchhon-blog, .list-group-item-switchhon-blog h4 {
transition: all 0.5s ease !important;
}
.list-group-item-switchhon-blog:hover {
color: #fff !important;
background-color: #2980b9 !important;
}
.list-group-item-switchhon-blog:hover h4 {
color: #fff !important;
}
.list-group-item-switchhon-blog {
transition: all 0.5s ease;
}
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"/>
<div class="list-group limited-list-group">
<a href="#" class="list-group-item clearfix list-group-item-switchhon-blog">
<div class="pull-left">
<img src="http://placehold.it/100x100" class="btn-center">
</div>
<div class="styled-group-right-item">
<h4 class="list-group-item-heading">Lorem Ipsum Dolor Sit Amet</h4>
<p class="list-group-item-text">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eget interdum libero. Vivamus pharetra faucibus.</p>
<span class="author-pubdate-info">Autor: John Doe | Fecha: 11 de Noviembre de 2014</span>
</div>
</a>
</div>
Just trigger the h4 on hover:
.list-group-item-switchhon-blog:hover h4{
transition: all 0.5s ease;
color: #fff;
}
FIDDLE
UPDATE
A better way is actually setting the h4 to inherit the color from it's parent:
.list-group-item-switchhon-blog h4{
color: inherit !important;
}
That way you don't have to duplicate code and add extra code for the hover out
NEW FIDDLE

Orange underline on an image hover

I need your help. Hope someone can teach me how do this.
I want to have an orange underline on an image hover like on the "latest projects" on this template. I have no idea how to do that and I would like to know. Your answers would be highly appreciated !
This is my HTML.
<div class="sixteen columns">
<h4 class="headline">Recent Work</h4>
</div>
<!-- 1/4 Column -->
<div class="four columns">
<div class="item-img"><img src="images/portfolio_images/portfolio_3_01.jpg" alt=""/><div class="overlay zoom"></div></div>
<div class="portfolio-item-meta">
<h5>SockMonkee</h5>
<p>Aenean sit amet ligula est, conseact etur lectus. Maecenas hendrerit, lorem.</p>
</div>
</div>
<!-- 1/4 Column -->
<div class="four columns">
<div class="item-img"><img src="images/portfolio_images/portfolio_3_06.jpg" alt=""/><div class="overlay zoom"></div></div>
<div class="portfolio-item-meta">
<h5>Franky Fisticuffs</h5>
<p>Aenean sit amet ligula est, conseact etur lectus. Maecenas hendrerit, lorem.</p>
</div>
</div>
<!-- 1/4 Column -->
<div class="four columns">
<div class="item-img"><img src="images/portfolio_images/portfolio_3_04.jpg" alt=""/><div class="overlay zoom"></div></div>
<div class="portfolio-item-meta">
<h5>Package Project</h5>
<p>Gravida sit amet ligula eget conseact etur lectu aecenas hendrerit bibenea.</p>
</div>
</div>
<!-- 1/4 Column -->
<div class="four columns">
<div class="item-img"><img src="images/portfolio_img_04.jpg" alt=""/><div class="overlay zoom"></div></div>
<div class="portfolio-item-meta">
<h5>Ampertastic Mr. Fox</h5>
<p>Fermentum sit amet ligula estabe, eget conseact lectus maecenas hendrerit.</p>
</div>
</div>
<div class="clearfix"></div>
And my CSS
.portfolio-item {margin-bottom: 20px;}
.portfolio-item-meta h5 {
font-size: 12px;
font-family: Arial, sans-serif;
font-weight: bold;
line-height: 16px;
padding: 12px 0 8px 0;
margin: 0 0 8px 0;
border-bottom: 1px solid #e7e7e7;
letter-spacing: 0;
}
.portfolio-item-meta h5 span {
display: block;
color: #888;
font-weight: normal;
margin-top: 3px;
}
.portfolio-item-meta a{color:#444;}
.portfolio-item-meta a:hover {color:#888;}
.portfolio-item-meta p {color: #555;}
.item-img, .post-img {position: relative;}
.overlay {
height: 100%;
left: 0;
position: absolute;
top: 0px;
width: 100%;
z-index: 1;
z-index: 40;
opacity: 0;
-moz-opacity: 0;
filter:alpha(opacity=0);
-webkit-transition: opacity 180ms ease-in-out;
-moz-transition: opacity 180ms ease-in-out;
-o-transition: opacity 180ms ease-in-out;
transition: opacity 180ms ease-in-out;
}
.overlay.zoom {background: url(../images/overlay.png) no-repeat center center, url(../images/overlay_bg.png) center center;}
.overlay:hover {
opacity: 1;
-moz-opacity: 1;
filter:alpha(opacity=100);
}
Have you tried this?
.item-img:hover {border-bottom: 1px solid orange;}
if it works you will need to add
transition: all 0.1s linear
for example, but you can find more here:
http://www.w3schools.com/css/css3_transitions.asp

Keep transition effect on 1 div from moving the div that follows?

1. I have a 4 column row of divs that move a little when hovered (with margin and padding). How can I keep this movement from moving the content that is below it without adding a fixed height. It is in a fluid layout so with a fixed height that allows enough room for the movement, the content below starts to get too far away as the window width is reduced and the images scale down.
2. For the bounty you need to make the jsFiddle work.
It seems that even though I have transition: all, all of the padding-bottom gets added instantly while the margin-top transitions for 300ms. Shouldn't the padding transition also? I think that would get rid of the jump. I tried transitioning height on hover for the same effect but it had the same exact issue. the height just got added instead of transitioning.
I made a jsFiddle to play with.
HTML:
<header class="sectionTitle lightboxes clearfix">
<h3><i class="i-small icon-folder-open"></i><strong>Portfolio</strong></h3>
</header>
<article id="row2fluid" role="presentation">
<section id="row2col1"> <a class="slider" href="#"><img src="http://mtctinc.com/images/folioImg1.jpg" alt="porfolio 1" />
<div class="caption">
<h3>Example 1</h3>
<span>Slider/Slideshow</span>
</div>
</a>
</section>
<section id="row2col2"> <a class="youtube" href="#"><img src="http://mtctinc.com/images/folioImg2.jpg" alt="portfolio 2" />
<div class="caption">
<h3>Example 2</h3>
<span>Youtube</span>
</div>
</a>
</section>
<section id="row2col3"> <a href="#" class="clearfix"><img src="http://mtctinc.com/images/folioImg3.jpg" alt="porfolio 3" />
<div class="caption">
<h3>Example 3</h3>
<span>Flash</span>
</div>
</a>
</section>
<section id="row2col4"> <a href="#" class="clearfix"><img src="http://mtctinc.com/images/folioImg4.jpg" alt="portfolio 4" />
<div class="caption">
<h3>Example 4</h3>
<span>HTML</span>
</div>
</a>
</section>
</article>
<div id="moreContent">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras eget nulla laoreet, blandit massa eu, mollis tellus. Duis pellentesque dui nec diam ullamcorper, ac dignissim sapien interdum. Proin in libero nec neque fermentum varius. Integer hendrerit, justo feugiat porttitor iaculis, nisl purus luctus neque, non ultrices magna quam et magna. Proin porttitor, metus sed commodo pharetra, lacus eros aliquet diam, eu auctor nisi diam quis felis.</div>
CSS:
.sectionTitle {
border-bottom: 3px solid #e9e9e9;
width:100%;
}
.sectionTitle h3 {
font-size:11px;
text-transform:uppercase;
font-weight:bold;
border-bottom: 3px solid #3b3b3b;
display:table;
margin-bottom: -2px;
float: left;
width: 100%;
min-height: 33px;
line-height: 19px;
padding-bottom: 10px;
}
.sectionTitle strong {
display: inline-block;
padding-left:10px;
line-height:14px;
}
.lightboxes {
position: relative;
clear:both;
padding-top: 30px;
}
#row2fluid {
text-align: center;
position: relative;
float: left;
width: 100%;
}
#row2fluid img {
opacity: .8;
border: none;
-webkit-transition:all 300ms;
-o-transition:all 300ms;
-moz-transition:all 300ms;
transition:all 300ms;
}
#row2fluid a:hover img {
opacity: 1;
margin-top: -16px;
}
#row2fluid a:hover .caption h3 {
color: #F15A2B;
}
#row2fluid .caption {
border-bottom: 1px solid #E9E9E9;
margin: 0px 3px;
line-height: .7em;
padding: 14px 0 30px;
}
#row2fluid a:hover .caption {
border-bottom: 1px solid #F15A2B;
background-color: #f7f7f7;
padding-bottom: 46px;
}
#row2fluid .caption span {
font-style: italic;
font-size: 12px;
color: #ACACAC;
}
#row2col1 {
clear: both;
float: left;
margin-left: 0;
width: 24.1758%;
display: inline-block;
padding-top: 40px;
margin-top: -1px;
}
#row2col2 {
clear: none;
float: left;
margin-left: 1.0989%;
width: 24.1758%;
display: inline-block;
padding-top: 40px;
margin-top: -1px;
}
#row2col3 {
clear: none;
float: left;
margin-left: 1.0989%;
width: 24.1758%;
display: inline-block;
padding-top: 40px;
margin-top: -1px;
}
#row2col4 {
clear: none;
float: left;
margin-left: 1.0989%;
width: 24.1758%;
display: inline-block;
padding-top: 40px;
margin-top: -1px;
}
#row2col1:hover {
border-top: 3px solid #F15A2B;
padding-top: 37px;
}
#row2col2:hover {
border-top: 3px solid #F15A2B;
padding-top: 37px;
}
#row2col3:hover {
border-top: 3px solid #F15A2B;
padding-top: 37px;
}
#row2col4:hover {
border-top: 3px solid #F15A2B;
padding-top: 37px;
}
#moreContent {
clear: both;
position: relative;
float: left;
margin-left: 0;
width: 100%;
display: block;
padding-top: 20px;
}
You just need to add
-webkit-transition:all 300ms;
-o-transition:all 300ms;
-moz-transition:all 300ms;
transition:all 300ms;
to the caption as well.
See here
http://jsfiddle.net/ZuU8V/4/