Responsive div over image - html

How can I make a responsive div over a responsive image?
I developed this code, however div does not fully accompany the image.
Can anybody help me?
codePen
HTML
<div class="container-fluid first">
<div class="row tab-pane Galeria">
<div class="col-sm-2">
<a class="d-block mb-4 h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/aob0ukAYfuI/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
<div class="col-sm-2">
<a class="d-block mb-4 h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/aob0ukAYfuI/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
<div class="col-sm-2">
<a class="d-block mb-4 h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/EUfxH-pze7s/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>

Can you please check out this code, we done minor modification in html and css, we also add some bootstrap classes for better view of the elements. Hope it will work for you.
.Galeria{
margin-top: 20px;
}
.image-item{
margin-bottom:20px;
}
.Images{
border-radius: .25rem;
width: 100%;
height: auto;
border-radius: 8px;
cursor: pointer;
}
.image-block{
position:relative;
}
.ImageText{
width: calc(100% - 20px);
height: auto;
background: #F0EDEB 0% 0% no-repeat padding-box;
border-radius: 8px 8px 0px 0px;
backdrop-filter: blur(25px);
-webkit-backdrop-filter: blur(50px);
position: absolute;
bottom: 0;
left: 10px;
padding: 10px;
box-sizing: border-box;
font-size: 16px;
font-family: "Segoe UI";
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid first">
<div class="row tab-pane Galeria">
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/aob0ukAYfuI/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/aob0ukAYfuI/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/EUfxH-pze7s/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/M185_qYH8vg/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/sesveuG_rNo/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
<div class="col-xl-2 col-lg-3 col-md-4 col-sm-6">
<div class="image-item">
<a class="d-block image-block h-100">
<img class="Images img-fluid" src="https://source.unsplash.com/AvhMzHwiE_0/400x300" alt="">
<div class="ImageText"> Name</div>
</a>
</div>
</div>
</div>
</div>

Maybe you can replace img tag with div which has image set as background.
Something like this:
<div class="Images" style="background: url(https://source.unsplash.com/aob0ukAYfuI/400x300)">
<div class="ImageText"> Name</div>
</div>
.Images {
position: relative;
background-size: cover !important;
width: 90%;
height: 100%;
border-radius: 10px;
}
.ImageText {
...
width: calc(100% - 46px) !important;
}

You can use the below CSS:
.Galeria a {
position: relative;
}
.ImageText {
left: 0;
width: 100%;
box-sizing: border-box;
}

Related

Customer Section's images stacked vertically on mobile screens bootstrap 5

I am trying to design my company's website. But all images in the customer section are stacked vertically on mobile devices. I am using Bootstrap 5.2. I have tried col-xs and col-md classes but was not able to achieve the output. I am attaching the code and image. Thanks For the Help.
/*
===========================================
Customer Section
===========================================
*/
.dot {
height: 20px;
width: 20px;
background-color: #3736b0;
border-radius: 50%;
display: block;
position: absolute;
top: 105rem;
left: 50%;
}
.section-4-title {
display: block;
position: absolute;
top: 108rem;
}
.section-4 {
margin-top: 3rem;
}
.card {
overflow: hidden;
height: 4rem;
width: 7rem;
border: none;
margin-top: 3rem;
margin-bottom: 1rem;
box-shadow: 1px 1px 12px 0 rgba(0, 0, 0, 0.2);
}
.card img {
height: 100%;
width: 100%;
}
.card-3 {
overflow: hidden;
height: 4rem;
width: 8rem;
border: none;
box-shadow: 1px 1px 12px 0 rgba(0, 0, 0, 0.2);
}
<!--
===========================================
Customer Logo Section
===========================================
-->
<div class="container">
<section class="section-4">
<div class="container text-center">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="dot"></div>
</div>
</div>
<div class="row">
<h2 class="section-4-title">
Simplifying communications for Industry
<div class="title-highlighter">Leaders in India and World</div>
</h2>
</div>
<div class="container">
<!-- Customer Row 1 -->
<div class="row bg-primary">
<div class="bg-dark col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-1.svg" class="img-fluid" alt="Logo 1" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-2.svg" class="img-fluid" alt="Logo 2" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card card-3">
<img src="svgs/logo-3.svg" alt="Logo 3" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-4.svg" alt="Logo 4" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-5.svg" alt="Logo 5" />
</div>
</div>
<div class="col-lg-2 col-sm-4 col-xs-6">
<div class="card">
<img src="svgs/logo-6.svg" alt="Logo 6" />
</div>
</div>
</div>
<!-- Customer Row 2 -->
<div class="row">
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card">
<img
src="svgs/logo-7.svg"
class="card-img-top"
alt="Logo 7"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card">
<img
src="svgs/logo-8.svg"
class="card-img-top"
alt="Logo 8"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card card-3">
<img
src="svgs/logo-9.svg"
class="card-img-top"
alt="Logo 9"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card card-10 py-2">
<img
src="svgs/logo-10.svg"
class="card-img-top"
alt="Logo 10"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card card-3">
<img
src="svgs/logo-11.svg"
class="card-img-top"
alt="Logo 11"
/>
</div>
</div>
<div class="col-lg-2 col-md-4 col-sm-6">
<div class="card">
<img
src="svgs/logo-12.svg"
class="card-img-top"
alt="Logo 12"
/>
</div>
</div>
</div>
</div>
</div>
</section>
</div>

bootstrap 4 - arrange images in particular?

I created a simple page in my Laravel and in that page, I have three sections which is mainly navigation, content and footer. I got the navigation and footer layout completed. In the content section, I wish to use bootstrap to place my images layout like this:
Image:
This is just a general idea but I need it to be responsive so it fits the mobile layout as well.
What I have tried is to use Masonry for CSS but it does not fit the mobile layout responsively. I tried using bootstrap 4 but the alignment between IMG3 and IMG4/5 are too far apart and placing margin does not align them near enough.
My code:
#section('content')
<div class="container">
<div class="row">
<div class="col-sm">
<img src="{{asset('/images/Home_Bed.jpg')}}" class="img-fluid custom-position-1" alt="">
</div>
<div class="col-sm col-8">
<img src="//via.placeholder.com/350x150" class="img-fluid custom-position-2" alt="">
</div>
<div class="col-sm custom-position-3">
<img src="{{asset('/images/Home_Kitchen.jpg')}}" class="img-fluid custom-position-3" alt="">
</div>
</div>
<div class="row align-items-end">
<div class="col col-8">
<img src="{{asset('/images/Shop_Page.jpg')}}" class=" img-fluid custom-position-4" alt="">
</div>
<div class="col">
<img src="{{asset('/images/Home_Sofa.jpg')}}" class="img-fluid custom-position-5" alt="">
</div>
</div>
</div>
#endsection
.row {
margin-bottom: 30px;
}
.custom-position-1{
position: relative;
bottom: -160px;
left: 50px;
height:100px;
object-fit: cover;
}
.custom-position-2{
position:relative;
right:100px;
object-fit:cover;
}
.custom-position-3{
position: relative;
bottom: -160px;
left: 50px;
height:100px;
object-fit: cover;
}
.custom-position-4{
position: relative;
height: 400px;
width:800px;
object-fit: cover;
}
.custom-position-5{
position: relative;
height:300px;
left:50px;
top: 100px;
object-fit: cover;
}
Does anyone have any idea how to make it good?
Are you looking for a solution like this?
If you want to have some spacing use margin classes.
img {
width: 100%;
height: 100%;
}
[class*="col-"],
.flex-grow-0 {
border: 1px solid black;
}
.img-fluid {
padding: 5px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"></script>
<div class="container">
<div class="row m-0">
<div class="col-8 p-0">
<div class="row m-0">
<div class="col-6 p-0">
<img src="http://placehold.it/300x300" class="img-fluid" alt="" />
</div>
<div class="col-6 p-0">
<img src="http://placehold.it/300x300" class="img-fluid" alt="" />
</div>
<div class="col-12 p-0">
<img src="http://placehold.it/300x300" class="img-fluid" alt="" />
</div>
</div>
</div>
<div class="col-4 p-0 d-flex">
<div class="d-flex flex-column">
<div class="flex-grow-0 mt-auto">
<img src="http://placehold.it/300x500" class="img-fluid" alt="" />
</div>
<div class="flex-grow-0">
<img src="http://placehold.it/400x400" class="img-fluid" alt="" />
</div>
</div>
</div>
</div>
</div>

Bootstrap 4 - Grid 1 and 2 Change position

Example what i need:
Image:
My code is this:
<div class="container">
<div class="row">
<div class="col-3">
<img src="image1.png" class="img-thumbnail float-left" alt="Novi Sad">
</div>
<div class="col-6">
<img src="image1.png" class="img-thumbnail mx-auto d-block" alt="Belgrade">
</div>
<div class="col-3">
<img src="image1.png" class="img-thumbnail float-right" alt="Niš">
</div>
</div>
<!-- THIS IS PROBLEM -->
<div class="row">
<!-- THIS COLUMN NEED TO BE BELOW 1 COLUMN / LEFT SIDE -->
<div class="col-3">
<img src="image1.png" class="img-thumbnail float-left" alt="Novi Sad">
</div>
<!-- THIS COLUMN NEED TO BE BELOW 3 COLUMN / RIGHT SIDE -->
<div class="col-3 ml-auto">
<img src="image1.png" class="img-thumbnail float-right" alt="Novi Sad">
</div>
</div>
<!-- END PROBLEM -->
<div class="row">
<div class="col-4">
<img src="image1.png" class="img-thumbnail float-left" alt="Novi Sad">
</div>
<div class="col-4">
<img src="image1.png" class="img-thumbnail mx-auto d-block" alt="Novi Sad">
</div>
<div class="col-4">
<img src="image1.png" class="img-thumbnail float-right" alt="Novi Sad">
</div>
</div>
</div>
I can't figure where is the problem. If someone know where problem is, write solution. Thanks
PS. Sorry for my Bad english
Thanks All..
Edit: I've updated my answer to include background images, and to mimic the original layout better. Thanks to AndreiGheorghiu for help answering this more accurately.
.grid{
display: grid;
grid-gap:10px;
height:500px;
grid-template-columns: 1fr .2fr 1fr .2fr 1fr;
grid-template-areas: "topLeft large large large topRight"
"midLeft large large large midRight"
"bottomLeft bottomLeft bottomCenter bottomRight bottomRight";
}
.pic{
background: url(https://placeimg.com/400/400/any) no-repeat center/cover;
font: 700 20px sans-serif;
color:white;
display:flex;
align-items:center;
justify-content:center;
text-shadow:2px 2px 5px #000;
}
.pic-1{
grid-area: topLeft;
}
.pic-2{
grid-area: large;
}
.pic-3{
grid-area: topRight;
}
.pic-4{
grid-area: midLeft;
}
.pic-5{
grid-area: midRight;
}
.pic-6{
grid-area: bottomLeft;
}
.pic-7{
grid-area: bottomCenter;
}
.pic-8{
grid-area: bottomRight;
}
<div class="grid">
<div class="pic pic-1">Foxwoods</div>
<div class="pic pic-2">New York City</div>
<div class="pic pic-3">Las Vegas</div>
<div class="pic pic-4">Philadelphia</div>
<div class="pic pic-5">San Francisco</div>
<div class="pic pic-6">Miami</div>
<div class="pic pic-7">Boston</div>
<div class="pic pic-8">Washington D.C.</div>
</div>
You can try this code,
Note: Included responsive classes. Run this code as a full page
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col">
<img src="https://via.placeholder.com/800x800" class="img-fluid img-thumbnail" alt="Novi Sad">
<img src="https://via.placeholder.com/800x800" class="img-fluid img-thumbnail mt-md-4" alt="Novi Sad">
</div>
<div class="col-md-6">
<img src="https://via.placeholder.com/800x800" class="img-fluid img-thumbnail" alt="Belgrade">
</div>
<div class="col">
<img src="https://via.placeholder.com/800x800" class="img-fluid img-thumbnail" alt="Niš">
<img src="https://via.placeholder.com/800x800" class="img-fluid img-thumbnail mt-md-4" alt="Novi Sad">
</div>
</div>
<div class="row mt-md-4">
<div class="col-md-4">
<img src="https://via.placeholder.com/800x800" class="img-fluid img-thumbnail" alt="Novi Sad">
</div>
<div class="col-md-4">
<img src="https://via.placeholder.com/800x800" class="img-fluid img-thumbnail" alt="Novi Sad">
</div>
<div class="col-md-4">
<img src="https://via.placeholder.com/800x800" class="img-fluid img-thumbnail" alt="Novi Sad">
</div>
</div>
</div>
You need to put the small images in the same col. And display them as blocks: display:block; width: 100%; height: auto;.
Here's how I'd personally do it. I'm using .no-gutter class on .rows and white borders on images:
[my-gallery]:not(#_) {
padding: 8px;
}
[my-gallery] img {
display: block;
background-color: #f5f5f5;
width: 100%;
height: auto;
border: 8px solid white;
}
[my-gallery] .strethed img {
height: 100%;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid" my-gallery>
<div class="row no-gutters">
<div class="col">
<img src="https://picsum.photos/300/200/?random" alt="Novi Sad">
<img src="https://picsum.photos/303/202/?random" alt="Novi Sad">
</div>
<div class="col-6 strethed">
<img src="https://picsum.photos/306/204/?random" alt="Belgrade">
</div>
<div class="col">
<img src="https://picsum.photos/309/206/?random" alt="Niš">
<img src="https://picsum.photos/312/208/?random" alt="Novi Sad">
</div>
</div>
<div class="row no-gutters" >
<div class="col">
<img src="https://picsum.photos/315/210/?random" alt="Novi Sad">
</div>
<div class="col">
<img src="https://picsum.photos/318/212/?random" alt="Novi Sad">
</div>
<div class="col">
<img src="https://picsum.photos/321/214/?random" alt="Novi Sad">
</div>
</div>
</div>

Image gallery thumbnail size with Bootstrap 4

I have a very simple responsive image gallery with 6 thumbnails only. In large and medium devices it shows perfectly. However, in mobile view, the thumbnails become way too small. If I add padding, the side margins "break" and they are no longer aligned. Is there a way to make them a bit bigger without "breaking" the side margins? I've posted images so it's easier to understand.
In the image below you can see that the side margins are aligned, but the thumbnails are too small.
And below you can see what happens when I add padding. The thumbnails are bigger, but the side margins are no longer aligned.
.container {
max-width: 98%;
margin: 0 auto;
}
.image-container {
background-color: #ffffff;
padding: 10px;
}
.main-image-container img {
max-width: 100%;
height: auto;
}
.thumbnail-image-container img {
max-width: 100%;
height: auto;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<div class="container mt-4">
<div class="row">
<div class="col-lg-7 image-container">
<div class="row">
<div class="col-12 main-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
</div>
<div class="row pt-2">
<div class="col-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
</div>
</div>
One solution would be adding the same padding to all col-* classes. Bootstrap have padding classes named p-*. Next example added the p-1 classes to main-image-container and thumbnail-image-container elements.
.container {
max-width: 98%;
margin: 0 auto;
}
.image-container {
background-color: #ffffff;
padding: 10px;
}
.main-image-container img {
max-width: 100%;
height: auto;
}
.thumbnail-image-container img {
max-width: 100%;
height: auto;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<div class="container mt-4">
<div class="row">
<div class="col-lg-7 image-container">
<div class="row">
<div class="col-12 p-1 main-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
</div>
<div class="row pt-2">
<div class="col-2 p-1 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 p-1 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 p-1 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 p-1 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 p-1 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-2 p-1 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
</div>
</div>
</div>
</div>
A second solution will be splitting the thumbnails into two rows using the right col-* classes. Like on next example:
.container {
max-width: 98%;
margin: 0 auto;
}
.image-container {
background-color: #ffffff;
padding: 10px;
}
.main-image-container img {
max-width: 100%;
height: auto;
}
.thumbnail-image-container img {
max-width: 100%;
height: auto;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<div class="container mt-4">
<div class="row">
<div class="col-lg-7 image-container">
<div class="row">
<div class="col-12 main-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
</div>
<div class="row pt-1">
<div class="col-4 col-md-2 mt-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-4 col-md-2 mt-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-4 col-md-2 mt-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-4 col-md-2 mt-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-4 col-md-2 mt-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
<div class="col-4 col-md-2 mt-2 thumbnail-image-container img-fluid">
<img src="https://placeholdit.co//i/1280x720?&text=Test">
</div>
</div>
</div>
</div>
</div>

Boostrap image not responsive in safari

I realized my website is not working on safari (desktop and mobile). For some reason the images are not responsive. I used a Bootstrap theme, the website is simple. Please help!
website: www.scanek.com
HTML:
<section id="portfolio" class="pfblock">
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<div class="pfblock-header wow fadeInUp">
<h2 class="pfblock-title">Categories</h2>
<div class="pfblock-subtitle">
</div>
</div>
</div>
</div><!-- .row -->
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/kitchen/index.html">
<figure class="effect-bubba">
<img src="assets/images/kitchens.jpg" alt="img01" class="img-responsive" />
<figcaption>
<h2> <span>Kitchens</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/bathroom//bathroom1/index.html">
<figure class="effect-bubba">
<img src="assets/images/bathrooms.jpg" alt="img01"/>
<figcaption>
<h2> <span>Bathrooms</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/fixtures/index.html">
<figure class="effect-bubba">
<img src="assets/images/fixtures.jpg" alt="img01"/>
<figcaption>
<h2>House<span> Fixtures</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
</div>
</div><!-- .container -->
</section>
CSS:
img {
max-width: 100%;
width: 100%;
height: auto;
}
.grid figure img {
position: relative;
display: block;
min-height: 100%;
max-width: 100%;
opacity: 0.8;
}
figure.effect-bubba img {
opacity: 0.75;
-webkit-transition: opacity 0.35s;
transition: opacity 0.35s;
}
Your css syntaks on link that you provide to us is not right, for the start,
you have:
img {
max-width: 100% width :100% height: auto;
}
try with :
img {
max-width: 100%;
width :100%;
height: auto;
}
after yo fix this issues, then if problem is still there we can try to help you..
In addiion to the CSS typo on img width(should be width: 100%;), you had .img-reponsive only on one image set.
Set .img-responsive on all images.
Check resizing on following fiddle: https://jsfiddle.net/Syden/5mfvj9v2/20/
Snippet below:
img {
max-width: 100%;
width: 100%;
height: auto;
}
.grid figure img {
position: relative;
display: block;
min-height: 100%;
max-width: 100%;
opacity: 0.8;
}
figure.effect-bubba img {
opacity: 0.75;
-webkit-transition: opacity 0.35s;
transition: opacity 0.35s;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<section id="portfolio" class="pfblock">
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-3">
<div class="pfblock-header wow fadeInUp">
<h2 class="pfblock-title">Categories</h2>
<div class="pfblock-subtitle">
</div>
</div>
</div>
</div>
<!-- .row -->
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/kitchen/index.html">
<figure class="effect-bubba">
<img src="https://placehold.it/200x500" alt="img01" class="img-responsive" />
<figcaption>
<h2> <span>Kitchens</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/bathroom//bathroom1/index.html">
<figure class="effect-bubba">
<img src="https://placehold.it/200x500" alt="img01" class="img-responsive" />
<figcaption>
<h2> <span>Bathrooms</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="grid wow zoomIn">
<a href="categories/fixtures/index.html">
<figure class="effect-bubba">
<img src="https://placehold.it/200x500" alt="img01" class="img-responsive" />
<figcaption>
<h2>House<span> Fixtures</span></h2>
<p></p>
</figcaption>
</figure>
</a>
</div>
</div>
</div>
</div>
<!-- .container -->
</section>