Getting Overlay / Shadow With 50% Opacity Over Images With CSS - html

I'm trying to get an overlay or box shadow on top of a row of images. Then when you hover over these images, the opacity of the shadow should change from 0.5 to 0.8 for that image. I have already tried the pseudo technique suggested here:
How To Get Shadow With Certain Opacity Over Images CSS
And applied styles to the divs beneath the images as it was suggested here:
Why doesn't inset box-shadow work over images?
Me + several other people haven't been able to figure this out.
The goal is to get the images to look the same as the other three images above the row - the picture of the business presentation, the picture of the business meeting, and the picture of the businesswoman. Each of them have an initial box shadow over them with 50% opacity - then when you hover over the buttons (see my work, contact, and visit store), the opacity over the image should change from 50% to 80%. We want that same technique to be applied to the images in the row.
HTML:
<div class="row thumbnail-row">
<div class="my-work-image" id="margin-left-image">
<img class="thumbnail-image" src="/wp-content/themes/gatewaywebdesign/assets/images/hamburger-thumbnail.jpg" />
<div class="img__description_layer">
<span class="img__description">The Hamburger Collection</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="/wp-content/themes/gatewaywebdesign/assets/images/yoyomoi-thumbnail.jpg" />
<div class="img__description_layer">
<span class="img__description">YoYoMoi</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="/wp-content/themes/gatewaywebdesign/assets/images/dogs-thumbnail.jpg" />
<div class="img__description_layer">
<span class="img__description">Dogs On Duty</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="/wp-content/themes/gatewaywebdesign/assets/images/gateway-thumbnail.jpg" />
<div class="img__description_layer">
<span class="img__description">Gateway Web Design</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="/wp-content/themes/gatewaywebdesign/assets/images/chameleon-thumbnail.jpg" />
<div class="img__description_layer">
<span class="img__description">Chameleon Web Solutions</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="/wp-content/themes/gatewaywebdesign/assets/images/adrienne-thumbnail.jpg" />
<div class="img__description_layer">
<span class="img__description">Adrienne Levin Coleman</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="/wp-content/themes/gatewaywebdesign/assets/images/castaway-thumbnail.jpg" />
<div class="img__description_layer">
<span class="img__description">Castaway Vacations</span>
</div>
</div>
CSS:
.thumbnail-row {
display: flex;
margin-top: 40px;
box-shadow: 0px 0px 0px 4000px rgba(27, 61, 88, 0.5) inset;
}
.thumbnail-row div::after {
position: relative;
top: 0; left: 0;
width: 100%;
height: 100%;
box-shadow: 0px 0px 0px 4000px rgba(27, 61, 88, 0.5) inset;
}
.thumbnail-image {
display: inline-block;
width: 100%;
/*opacity: 0.5;*/
/*box-shadow: inset 0 0 0 4000px rgba(27,61,88,.5)!important;*/
}
.my-work-image{
position:relative;
}
.img__description_layer {
position: absolute;
top: 0;
bottom: 0;
left: 0; /*change it to 50%, if you want the text only shows in the half part */
right: 0;
background: rgba(27,61,88, 0.8);
color: #ffffff;
visibility: hidden;
opacity: 0;
display: flex;
align-items: center;
text-align:center;
font-family: 'proxima_nova_ltsemibold';
box-shadow: 0px 0px 0px 4000px rgba(27, 61, 88, 0.5) inset;
/* transition effect. not necessary */
transition: opacity ease-in-out 0.4s, visibility ease-in-out 0.4s;
/*transition: box-shadow 0.4s ease-in-out;*/
}
.my-work-image:hover .img__description_layer {
visibility: visible;
opacity: 1;
}
.img__description {
transition: .2s;
transform: translateY(1em);
margin: 0 auto;
}
.my-work-image:hover .img__description {
transform: translateY(0);
}
#margin-left-image {
margin-left: 15px;
}
JSFiddle
Any other ideas for getting the images to have an initial box shadow over them?

The box-shadow isn't showing because the box-shadow is on the parent of the imgs, so the imgs are covering the box-shadow. You can move the imgs behind the parent by adding position: relative; z-index: -1;
.thumbnail-row {
display: flex;
margin-top: 40px;
box-shadow: 0px 0px 0px 4000px rgba(27, 61, 88, 0.5) inset;
}
.thumbnail-row div::after {
position: relative;
top: 0; left: 0;
width: 100%;
height: 100%;
box-shadow: 0px 0px 0px 4000px rgba(27, 61, 88, 0.5) inset;
}
.thumbnail-image {
display: inline-block;
width: 100%;
/*opacity: 0.5;*/
/*box-shadow: inset 0 0 0 4000px rgba(27,61,88,.5)!important;*/
}
.my-work-image{
position:relative;
}
.img__description_layer {
position: absolute;
top: 0;
bottom: 0;
left: 0; /*change it to 50%, if you want the text only shows in the half part */
right: 0;
background: rgba(27,61,88, 0.8);
color: #ffffff;
visibility: hidden;
opacity: 0;
display: flex;
align-items: center;
text-align:center;
font-family: 'proxima_nova_ltsemibold';
box-shadow: 0px 0px 0px 4000px rgba(27, 61, 88, 0.5) inset;
/* transition effect. not necessary */
transition: opacity ease-in-out 0.4s, visibility ease-in-out 0.4s;
/*transition: box-shadow 0.4s ease-in-out;*/
}
.my-work-image:hover .img__description_layer {
visibility: visible;
opacity: 1;
}
.img__description {
transition: .2s;
transform: translateY(1em);
margin: 0 auto;
}
.my-work-image:hover .img__description {
transform: translateY(0);
}
#margin-left-image {
margin-left: 15px;
}
.thumbnail-image {
position: relative;
z-index: -1;
}
<div class="row thumbnail-row">
<div class="my-work-image" id="margin-left-image">
<img class="thumbnail-image" src="http://i.imgur.com/mNoKbYK.jpg" />
<div class="img__description_layer">
<span class="img__description">The Hamburger Collection</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="http://i.imgur.com/8b2sb03.jpg" />
<div class="img__description_layer">
<span class="img__description">YoYoMoi</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="http://i.imgur.com/Ac11pRH.jpg" />
<div class="img__description_layer">
<span class="img__description">Dogs On Duty</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="http://i.imgur.com/DgNt5MQ.jpg" />
<div class="img__description_layer">
<span class="img__description">Gateway Web Design</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="http://i.imgur.com/SG0bpMU.jpg" />
<div class="img__description_layer">
<span class="img__description">Chameleon Web Solutions</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="http://i.imgur.com/x1DxQwd.jpg" />
<div class="img__description_layer">
<span class="img__description">Adrienne Levin Coleman</span>
</div>
</div>
<div class="my-work-image">
<img class="thumbnail-image" src="http://i.imgur.com/YcnOqR1.jpg" />
<div class="img__description_layer">
<span class="img__description">Castaway Vacations</span>
</div>
</div>
</div><!--end row-->

Related

play animation on hover and after once it ran pause until not hover

I wanna create titles for a menu bar (that discribe what that syble means in the menu). So once the use hover the menu, I want to display the titles with smooth animation and keep then until the user hover the menu. It's posible to do with Java Script but I'm finding a way to do that only with CSS. couse I think it's so efficient.
index.html
<div class="menu-bar-holder">
<div class="sub-menu-bar">
<div class="menu-item" onclick="window.location.href='../'">
<img src="../images/logo-hero.png" alt="">
</div>
<!--
<div class="menu-item go-top-menu" onclick="topFunction()" id="">
<img src="../images/svg/extension-puzzle-outline.svg" alt="">
</div>-->
<div class="menu-item">
<img src="../images/svg/apps-outline.svg" alt="">
</div>
<hr width="100%" color="black">
<div class="menu-item">
<img src="../images/svg/cart-outline.svg" alt="">
</div>
<div class="menu-item">
<img src="../images/svg/log-in-outline.svg" alt="">
</div>
</div>
<div class="sub-menu-bar-item-names">
<div class="menu-item">Home page</div>
<!--<div class="menu-item go-top-menu" id="">go to the top</div>-->
<div class="menu-item">catogories</div>
<hr width="0" color="white" style="opacity: 0; visibility: hidden;">
<div class="menu-item">cart</div>
<div class="menu-item">log-in</div>
</div>
</div>
style.css
.sub-menu-bar-item-names .menu-item{
width: fit-content;
height: 50px;
padding-left: 10px;
padding-right: 10px;
display: flex;
justify-content: center;
align-items: center;
background-color: #ffffff66;
box-shadow: rgba(17, 17, 26, 0.1) 0px 8px 24px, rgba(17, 17, 26, 0.1) 0px 16px 56px, rgba(17, 17, 26, 0.1) 0px 24px 80px;
backdrop-filter: blur(20px);
margin-top: 5px;
margin-bottom: 5px;
border-radius: 10px;
cursor: pointer;
transition-duration: 1s;
transform: translateX(-300px);
opacity: 0;
transition-delay: 0.1s;
visibility: hidden;
z-index: 0;
display: none;
}
#keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
visibility: visible;
transform: translateX(0px);
-webkit-animation-play-state:paused;
-moz-animation-play-state:paused;
-o-animation-play-state:paused;
animation-play-state:paused;
cursor: pointer;
}
}
/*https://stackoverflow.com/questions/4502633/how-to-affect-other-elements-when-one-element-is-hovered*/
body:has(.sub-menu-bar .menu-item:hover) .sub-menu-bar-item-names .menu-item {
display: flex;
animation: fadeIn 1s;
}
I wanna pause the fadeIn animation, when once it played, until the .sub-menu-bar .menu-item:hover
Not 100% clear on what you're trying to achieve but it sounds like animation-iteration-count might be what you're looking for. You can set the iteration count to 1 so it'll only play once on each hover trigger.

How can I make Hover overlay text fixed to an Image

This is the portion of my HTML: I want to have to the text fixed to an image and not disappear when I stop hovering on the text.
.overlay1 {
position: relative;
bottom: 0;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.5); /* Black see-through */
color: #f1f1f1;
width: 100%;
transition: .5s ease;
opacity:0;
color: white;
font-size: 20px;
padding: 20px;
text-align: center;
}
/*Test hover*/
.container1:hover .overlay1 {
opacity: 0.5;
}
<div class="container1">
<a href="/content/gallery">
<div class="columny">
<div class="row1">
<img src="sites/chau.ac.zm/themes/chau/images/AF.jpg" alt="Snow" class="image" style="width:100%">
<!-- <div class="overlay1"> -->
<div class="overlay1">Gallery</div>
<!-- </div> -->
</div>
</div>
</a>
</div>
If I get you right, you want div.overlay1 to
be invisible initially
be visible on hover over div.container1
stay visible even if you hover out of div.container1
You cannot achieve 3. without using JavaScript.
I suggest this code:
/* You need this container to limit the .overlay1 position */
.img-container {
position: relative;
}
.overlay1 {
position: absolute;
bottom: 0;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.5); /* Black see-through */
color: #f1f1f1;
width: 100%;
transition: .5s ease;
opacity:0;
color: white;
font-size: 20px;
padding: 20px;
text-align: center;
}
/*Test hover - change :hover to class .visible */
.container1.visible .overlay1 {
opacity: 0.5;
}
<div id="container1" class="container1">
<a href="/content/gallery">
<div class="columny">
<div class="row1">
<div class="img-container">
<img src="https://images.unsplash.com/photo-1462899006636-339e08d1844e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&h=150&q=80" alt="Snow" class="image" style="width:100%">
<!-- <div class="overlay1"> -->
<div class="overlay1">Gallery</div>
<!-- </div> -->
</div>
</div>
</div>
</a>
</div>
<script>
// get element
var container1 = document.getElementById("container1");
// add hover event function
container1.addEventListener("mouseover", function() {
container1.className = "container1 visible";
});
</script>
See the solution if it works!
Just one question:
If you need a text to be fixed to an image, then why are you using hover?
.overlay1 {
position: absolute;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.5); /* Black see-through */
color: #f1f1f1;
width: auto;
transition: .5s ease;
opacity:1;
color: white;
font-size: 20px;
padding: 20px;
text-align: center;
right:-20px;
top:50%;
}
.row1{
position:relative;
width:500px; margin:0 auto;
}
<div class="container1">
<a href="/content/gallery">
<div class="columny">
<div class="row1">
<img src="https://image.shutterstock.com/image-photo/field-spring-flowers-sunlight-450w-377208970.jpg" alt="" />
<!-- <div class="overlay1"> -->
<div class="overlay1">Gallery</div>
<!-- </div> -->
</div>
</div>
</a>
</div>
remove class from gallery div
<div class="overlay1">Gallery</div> remove the class and use without any "overlay1"class

How can i make hover effect on image with caption

so im having little bit of strugle making this work.
So basicly what i am trying to make is image with caption under it and when you hover over image it gets greenish color with transparency and a plus sign on it.
What ive tried so far is to make <div class=parent> and inside of <div class=parent> i would have <img> and another <div class="overlay">
HTML
<section class="gallery">
<div class="container">
<div class="row">
<div class="parent">
<img src="img/showcase.jpg">
<div class="overlay">
<i class="fas fa-plus"></i>
</div>
</div>
</div>
</div>
</section>
CSS
.gallery .overlay {
background: rgba(0, 188, 156, 0);
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
} /* this div overlay will be greenish transparent color over an image when image is hovered */
.gallery .parent {
margin-top: 40px;
} /* this is just some spacing when images go one under another */
.gallery .parent:hover .overlay {
background: rgba(0, 188, 156, 0.8);
}
.gallery .parent:hover .fa-plus {
color: white;
}
.gallery .fa-plus {
position: absolute;
top: 50%;
left: 50%;
color: rgba(255, 255, 255, 0);
font-size: 1.75em;
}
so this works perfectly fine.
But when i put caption in my HTML.
<section class="gallery">
<div class="container">
<div class="row">
<div class="parent">
<img src="img/showcase.jpg">
<div class="overlay">
<i class="fas fa-plus"></i>
</div>
<div class="caption">
<h5>Lorem ipsum dolor.</h5>
<h6>lorem</h6>
</div>
</div>
</div>
<div class="overlay"> stretches all the way down
im running out of ideas how to make this possible especially because i need it to be responsive, images are changing widths and heights based on the resolution so i can put <div class="overlay> height on 80% or 90%
EG on medium devices.
Put the image inside its own container where you can add the overlay:
.img-container {
display:inline-block;
position:relative;
}
.img-container img {
display:block;
}
.overlay {
background: rgba(0, 188, 156, 0);
display: block;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}
.gallery .parent {
margin-top: 40px;
}
.gallery .img-container:hover .overlay {
background: rgba(0, 188, 156, 0.8);
}
.gallery .img-container:hover .fa-plus {
color: white;
}
.gallery .fa-plus {
position: absolute;
top: 50%;
left: 50%;
color: rgba(255, 255, 255, 0);
font-size: 1.75em;
}
<section class="gallery">
<div class="container">
<div class="row">
<div class="parent">
<div class="img-container">
<img src="https://lorempixel.com/400/200/ ">
<div class="overlay ">
<i class="fas fa-plus ">+</i>
</div>
</div>
<div class="caption ">
<h5>Lorem ipsum dolor.</h5>
<h6>lorem</h6>
</div>
</div>
</div>

How to properly position divs for overlay hover effect with text underneath

I have two rows of 4-boxed divs. The goal is to have a header within each box, and then hovering over the box will present more detailed p text with a faded background. I'm close, I just can't figure out how to actually layer the span overlay on top of the div instead of it being padded out of the way. Any help would be hugely appreciated!
.box {
width: 200px;
float: left;
box-shadow: inset 1px 1px 40px 0 rgba(90, 90, 90, .25);
margin: 5% auto 0 auto;
background-color: #DE5D40;
background-size: cover;
border-radius: 5px;
overflow: hidden;
}
.overlay {
background: rgba(0, 0, 0, .75);
text-align: center;
padding: 45px 0 66px 0;
opacity: 0;
-webkit-transition: opacity .25s ease;
-moz-transition: opacity .25s ease;
z-index: 10;
}
.box:hover .overlay {
opacity: 1;
}
.overlayText {
font-family: Helvetica;
font-weight: 14;
color: rgba(255, 255, 255, .85);
font-size: 14px;
}
.one-fourth.box {
margin-bottom: 20px;
height: 130px;
}
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.one-fourth,
.one-half,
.one-sixth,
.one-third,
.three-fourths,
.three-sixths,
.two-fourths,
.two-sixths,
.two-thirds {
float: left;
margin-left: 2.564102564102564%;
}
.one-half,
.three-sixths,
.two-fourths {
width: 48.717948717948715%;
}
.one-third,
.two-sixths {
width: 31.623931623931625%;
}
.four-sixths,
.two-thirds {
width: 65.81196581196582%;
}
.one-fourth {
width: 23.076923076923077%;
}
.three-fourths {
width: 74.35897435897436%;
}
.one-sixth {
width: 14.52991452991453%;
}
.five-sixths {
width: 82.90598290598291%;
}
.first {
clear: both;
margin-left: 0;
}
<div class="one-fourth first box box1">
<h3>SEO</h3>
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box2">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box3">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box4">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth first box box5">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box6">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box7">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box8">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
Check the code below should be what your after.
They key here is positioning.
What you want is a box that overlays its container and has text in the dead center.
In these instances position:absolute & position:relative mean everything.
A small understanding of relativity would help in this situation but until you crack open a copy of the theory of relativity you can have this.
Your container will be relatively positioned. this means it is positioned relatively to the content surrounding it. But it also has a second cascaded function.
It tell's an absolutely positioned element to behave Absolutely relative to its container.
so when this happens we can use top,bottom,left & right to control where it should sit in the container absolutely.
so what we want to happen is for your text to sit dead center so in this case we tell it to have top,left,bottom & right 0px & margin:auto;
This will tell your element that it is not taking positioning rules from any one point of your container and it wants its marginalizing to be automatically thought out, but since you have defined all the axis that it can be positioned from it will margin it to the center.
Hope it help's you understand a little on why this happens.
.box {
position: relative;
width: 200px;
float: left;
box-shadow: inset 1px 1px 40px 0 rgba(90, 90, 90, .25);
margin: 5% auto 0 auto;
background-color: #DE5D40;
background-size: cover;
border-radius: 5px;
overflow: hidden;
}
.overlay {
top: 0px;
left: 0px;
position: absolute;
background: rgba(0, 0, 0, .75);
text-align: center;
opacity: 0;
-webkit-transition: opacity .25s ease;
-moz-transition: opacity .25s ease;
z-index: 10;
width:100%;
height:inherit;
}
.box:hover .overlay {
opacity: 1;
}
.overlayText {
position: absolute;
margin: auto;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
font-family: Helvetica;
font-weight: 14;
color: rgba(255, 255, 255, .85);
font-size: 14px;
height:15px;
}
.one-fourth.box {
margin-bottom: 20px;
height: 130px;
}
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.one-fourth,
.one-half,
.one-sixth,
.one-third,
.three-fourths,
.three-sixths,
.two-fourths,
.two-sixths,
.two-thirds {
float: left;
margin-left: 2.564102564102564%;
}
.one-half,
.three-sixths,
.two-fourths {
width: 48.717948717948715%;
}
.one-third,
.two-sixths {
width: 31.623931623931625%;
}
.four-sixths,
.two-thirds {
width: 65.81196581196582%;
}
.one-fourth {
width: 23.076923076923077%;
}
.three-fourths {
width: 74.35897435897436%;
}
.one-sixth {
width: 14.52991452991453%;
}
.five-sixths {
width: 82.90598290598291%;
}
.first {
clear: both;
margin-left: 0;
}
<div class="one-fourth first box box1">
<h3>SEO</h3>
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box2">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box3">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box4">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth first box box5">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box6">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box7">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
<div class="one-fourth box box8">
<div class="overlay">
<span class="overlayText">SEO</span>
</div>
</div>
If i understand your problem correctly you need to use position:absolute for your .overlay div to position it on top of your .box div.
You can try this:
.box { position: relative}
.overlay{position:absolute;
top:0px;
left:0px}
Do this:
.box {
position:relative;
}
.overlay {
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
}

Placing text in the center-bottom of a div with overlay and image

I am trying to place some text in the center-bottom of a div which contains an overlay and image.
But how can i achieve this?
HTML code:
<div class="container">
<div class="row team-images">
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x400" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x400" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x400" class="img-responsive" alt="" />
</div>
</div>
</div>
</div>
CSS code:
.team-images .team-item {
position: relative;
}
.team-images img {
width: 100%;
height: 100%;
margin: 0 0 15px;
}
.team-images .team-image-overlay {
position: absolute;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(41, 128, 185, 0.4);
color: #fff;
-webkit-transition: all ease .5s;
-moz-transition: all ease .5s;
transition: all ease .5s;
}
.team-images .team-image-overlay:hover {
background: rgba(24, 188, 156, 0);
}
Here is a complete example of whats created so far: https://jsfiddle.net/prp794Lb/1/
How about this?
<div class="container">
<div class="row team-images">
<div class="col-sm-3">
<div class="team-item">
<div class="team-text">Text here</div>
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x400" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-text">Lots and lots and lots and lots and lots of text here</div>
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x400" class="img-responsive" alt="" />
</div>
</div>
<div class="col-sm-3">
<div class="team-item">
<div class="team-text">Text here</div>
<div class="team-image-overlay"></div>
<img src="http://placehold.it/400x400" class="img-responsive" alt="" />
</div>
</div>
</div>
/* Latest compiled and minified CSS included as External Resource*/
/* Optional theme */
#import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
body {
margin: 10px;
}
.team-images .team-item {
position: relative;
}
.team-images img {
width: 100%;
height: 100%;
margin: 0 0 15px;
}
.team-images .team-image-overlay {
position: absolute;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(41, 128, 185, 0.4);
color: #fff;
-webkit-transition: all ease .5s;
-moz-transition: all ease .5s;
transition: all ease .5s;
}
.team-images .team-image-overlay:hover {
background: rgba(24, 188, 156, 0);
}
.team-item .team-text {
position: absolute;
width: 100%;
bottom: 0;
text-align: center;
}
https://jsfiddle.net/wL5Lf5se/3/
Go for span inside overlay and style it like this:
Demo
.team-images .team-image-overlay span {
display:block;
text-align:center;
position:absolute;
bottom:20px;
left:20px;
right:20px;
opacity:0;
transition: all .3s ease;
color:#333;
}
.team-images .team-image-overlay:hover span {
display:block;
text-align:center;
position:absolute;
bottom:20px;
left:20px;
right:20px;
opacity:1;
}