Equal height and width boxes in Bootstrap? - html

I am trying to make the bottom right greyish box (the one without image) same height and width as other boxes with images. It is supposed to be responsive but if I manage to make it fit this resolution it doesn't work in other resolutions. I tried with flexbox but couldn't make it work. I am using Bootstrap as you can see. I also tried using vh and vw but no luck...
I would really appreciate if someone with more experience could tell me the proper way to do this? Thanks all for reading and trying to help!
Here is the screenshot of what I am trying to achieve:
Here is my code so far:
<!-- T E A M S E C T I O N -->
<section id="team" class="no-padding">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
<h1><span class="orange">[ </span>Meet Our Team<span class="orange"> ]</span></h1>
<p>A perfect blend of creativity and technical wizardry.</br>The best people formula for great websites!</p>
</div>
</div>
<div class="row no-gutter">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/1.jpg" title="">
<img src="img/team/1.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/2.jpg" title="">
<img src="img/team/2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/3.jpg" title="">
<img src="img/team/3.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/4.jpg" title="">
<img src="img/team/4.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/5.jpg" title="">
<img src="img/team/5.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/6.jpg" title="">
<img src="img/team/6.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/7.jpg" title="">
<img src="img/team/7.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/8.jpg" title="">
<img src="img/team/8.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="team-box">
<div class="team-box-last">
<h3>Want to join our team?</h3>
<p>We’re always looking for talented designers, developers, project managers and anyone who’s driven and has a passion for the digital industries.
</p>
<ul>
<li>Check our jobs page</li>
<li>Send us your CV</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
/* -------- TEAM SECTION -------- */
#team{
background-color: #fff;
text-align: center;
width: 100%;
}
#team h1{
color: #345;
font-weight: 700;
margin-top: 50px;
margin-bottom: 50px;
}
#team p{
color: #345;
font-size: 21px;
margin-top: 0px;
margin-bottom: 50px;
padding-left: 15px;
padding-right: 15px;
}
.no-padding {
padding: 0;
}
.no-gutter > [class*=col-] {
padding-right: 0;
padding-left: 0;
}
.team-box {
display: block;
position: relative;
margin: 0 auto;
max-width: 650px;
overflow: hidden;
}
.team-box img{
-moz-transition: all 1s;
-webkit-transition: all 1s;
transition: all 1s;
}
.team-box:hover img {
-moz-transform: scale(1.1);
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
.team-box .team-box-caption {
display: block;
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
text-align: center;
color: #fff;
opacity: 1;
background: transparent;
/* background: rgba(67,208,243,0.9);
-webkit-transition: all .35s;
-moz-transition: all .35s;
transition: all .35s; */
}
.team-box .team-box-caption .team-box-caption-content {
position: absolute;
bottom: 12px;
width: 100%;
text-align: left;
}
.team-box .team-box-caption .team-box-caption-content .name,
.team-box .team-box-caption .team-box-caption-content .position {
padding: 0 15px;
text-shadow: 0px 0px 5px #000;
}
.team-box .team-box-caption .team-box-caption-content .name {
text-transform: uppercase;
font-size: 12px;
font-weight: 700;
}
.team-box .team-box-caption .team-box-caption-content .position {
font-size: 12px;
text-transform: uppercase;
}
.team-box:hover .team-box-caption {
opacity: 1;
}
#media(min-width:768px) {
.team-box .team-box-caption .team-box-caption-content .name {
font-size: 15px;
}
.team-box .team-box-caption .team-box-caption-content .position {
font-size: 15px;
text-transform: uppercase;
}
}
.team-box-last{
text-align: left;
padding: 30px 30px;
}
.team-box:last-child{
background-color: #f3f3f3;
}
#team .team-box-last h3{
color: #345;
padding-top: 15px;
padding-left: 15px;
}
#team .team-box-last p{
font-size: 18px;
line-height: 23px;
padding-top: 15px;
margin-bottom: 30px;
}
#team .team-box-last ul{
padding-left: 15px;
}
#team .team-box-last ul li{
font-size: 18px;
font-weight: 500;
}
#team .team-box-last ul li{
list-style: none;
}

Well, you cannot really achieve this with CSS, you may add some Javascript code using jQuery to make it easier for you.
I am giving you an example just have a look to get an idea. The idea is to get the height of each image box which I have assigned id="getheight" and then add that height to the last box. Remember you need to use overflow:hidden if you want to see same height. I have altered your code and add some class and javascript to give you what you can do.
The problem in responsiveness in the last box is you need to also handle font-size or other stuff to make sure it always appears and perfect which I haven't touched that yet. However, you can still have scrollbar for longer text if you want.
All in all, this is one approach to solve your problem, there maybe more ways if spend more time.
** Please copy and see in bigger screen for responsiveness as well we watch console to see dynamic height. ***
var picHeight = $('#getheight').height();
$('.sameHeight').css('height',picHeight + 'px');
$('.team-box-last').css('height',picHeight + 'px')
$(window).on('resize',function(){
var picHeight = $('#getheight').height();
$('.sameHeight').css('max-height',picHeight + 'px');
})
/* -------- TEAM SECTION -------- */
#team{
background-color: #fff;
text-align: center;
width: 100%;
}
#team h1{
color: #345;
font-weight: 700;
margin-top: 50px;
margin-bottom: 50px;
}
#team p{
color: #345;
font-size: 21px;
margin-top: 0px;
margin-bottom: 50px;
padding-left: 15px;
padding-right: 15px;
}
.no-padding {
padding: 0;
}
.no-gutter > [class*=col-] {
padding-right: 0;
padding-left: 0;
}
.team-box {
display: block;
position: relative;
margin: 0 auto;
max-width: 650px;
overflow: hidden;
}
.team-box img{
-moz-transition: all 1s;
-webkit-transition: all 1s;
transition: all 1s;
}
.team-box:hover img {
-moz-transform: scale(1.1);
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
.team-box .team-box-caption {
display: block;
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
text-align: center;
color: #fff;
opacity: 1;
background: transparent;
/* background: rgba(67,208,243,0.9);
-webkit-transition: all .35s;
-moz-transition: all .35s;
transition: all .35s; */
}
.team-box .team-box-caption .team-box-caption-content {
position: absolute;
bottom: 12px;
width: 100%;
text-align: left;
}
.team-box .team-box-caption .team-box-caption-content .name,
.team-box .team-box-caption .team-box-caption-content .position {
padding: 0 15px;
text-shadow: 0px 0px 5px #000;
}
.team-box .team-box-caption .team-box-caption-content .name {
text-transform: uppercase;
font-size: 12px;
font-weight: 700;
}
.team-box .team-box-caption .team-box-caption-content .position {
font-size: 12px;
text-transform: uppercase;
}
.team-box:hover .team-box-caption {
opacity: 1;
}
#media(min-width:768px) {
.team-box .team-box-caption .team-box-caption-content .name {
font-size: 15px;
}
.team-box .team-box-caption .team-box-caption-content .position {
font-size: 15px;
text-transform: uppercase;
}
}
.sameHeight{
overflow:hidden;
}
.team-box-last{
text-align: left;
overflow:auto;
padding:30px 30px;
}
.team-box:last-child{
background-color: #f3f3f3;
}
#team .team-box-last h3{
color: #345;
padding-left: 15px;
}
#team .team-box-last p{
font-size: 18px;
line-height: 23px;
padding-top: 15px;
margin-bottom: 30px;
}
#team .team-box-last ul{
padding-left: 15px;
}
#team .team-box-last ul li{
font-size: 18px;
font-weight: 500;
}
#team .team-box-last ul li{
list-style: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- T E A M S E C T I O N -->
<section id="team" class="no-padding">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
<h1><span class="orange">[ </span>Meet Our Team<span class="orange"> ]</span></h1>
<p>A perfect blend of creativity and technical wizardry.</br>The best people formula for great websites!</p>
</div>
</div>
<div class="row no-gutter">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4" id="getheight" >
<a class="team-box" rel="" href="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/2.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/3.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/4.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/5.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/6.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/7.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/8.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 sameHeight">
<div class="team-box">
<div class="team-box-last">
<div class="t">
<h3>Want to join our team?</h3>
<p>We’re always looking for talented designers, developers, project managers and anyone who’s driven and has a passion for the digital industries.
</p>
<ul>
<li>Check our jobs page</li>
<li>Send us your CV</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<br/>
<br/>
<br/>
<br/><br/>
<br/>
<br/>
<br/>
<br/>
I also included resize option to tell how you can handle automatic height size.
Please feel free to change my code and make that nice and compatible with your requirement.

Related

css issue when using language switcher

My page
I have installed a language switcher plugin, from LTR to RTL. in this page their is a raw html raw
THE ISSUE: when i switch the language to RTL the boxes goes to the extreme right and extreme left
what to add so when the user switches the language the boxes would have the same alignment as the english version
Code:
<div class="vc_row wpb_row vc_row-fluid" style="background: white;">
<div class="wpb_column vc_column_container vc_col-sm-12">
<div class="vc_column-inner">
<div class="wpb_wrapper">
<div class="vc_empty_space" style="height: 32px"><span class="vc_empty_space_inner"></span></div>
<div class="vc_empty_space" style="height: 32px"><span class="vc_empty_space_inner"></span></div>
<div class="widget-text-heading no-line">
<h3 class="title">
<span>WHY INVEST IN</span>
DUBAI ? </h3>
</div>
<div class="widget widget-features-box default">
<div class="content">
<div class="row">
<div class="col-xs-12 col-sm-6 box-align1">
<div class="feature-box box-model">
<div class="feature-box-inner">
<div class="fbox-icon">
<div class="icon-inner ">
<img class="img" src="https://new.universalprime.co/wp-content/uploads/2020/01/Asset-5#2x.png" alt="">
</div>
</div>
<div class="fbox-content ">
<h3 class="ourservice-heading">EXPO 2020</h3>
<div class="description">It expected that roughly 28 million people will visit Dubai by Expo 2020</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 box-align2">
<div class="feature-box box-model">
<div class="feature-box-inner">
<div class="fbox-icon">
<div class="icon-inner ">
<img class="img" src="https://new.universalprime.co/wp-content/uploads/2020/01/Asset-2#2x.png" alt="">
</div>
</div>
<div class="fbox-content ">
<h3 class="ourservice-heading">MULTI-SECTORED ECONOMY</h3>
<div class="description">65% of global investment and a multi-sectored economy that does not rely on oil.</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 box-align1">
<div class="feature-box box-model">
<div class="feature-box-inner">
<div class="fbox-icon">
<div class="icon-inner ">
<img class="img" src="https://new.universalprime.co/wp-content/uploads/2020/01/Asset-8#2x.png" alt="">
</div>
</div>
<div class="fbox-content ">
<h3 class="ourservice-heading">INVESTMENT-FRIENDLY</h3>
<div class="description">A safe country for investment, supported with 0% income tax policy and facilitated by laws that ease business creation.</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 box-align2">
<div class="feature-box box-model">
<div class="feature-box-inner">
<div class="fbox-icon">
<div class="icon-inner ">
<img class="img" src="https://new.universalprime.co/wp-content/uploads/2020/01/Asset-7#2x.png" alt="">
</div>
</div>
<div class="fbox-content ">
<h3 class="ourservice-heading">PASSPORT RECOGNITION</h3>
<div class="description" style="margin: 0 0 26px 0;">The strongest Passport
<br>world-wide</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 box-align1">
<div class="feature-box box-model">
<div class="feature-box-inner">
<div class="fbox-icon">
<div class="icon-inner ">
<img class="img" src="https://new.universalprime.co/wp-content/uploads/2020/01/Asset-3#2x.png" alt="">
</div>
</div>
<div class="fbox-content ">
<h3 class="ourservice-heading">GLOBAL HUB</h3>
<div class="description">Dubai airport is considered the 3rd most visited in the world, they celebrated the 1 Billionth traveler in 2018</div>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 box-align2">
<div class="feature-box box-model">
<div class="feature-box-inner">
<div class="fbox-icon">
<div class="icon-inner ">
<img class="img" src="https://new.universalprime.co/wp-content/uploads/2020/01/Asset-6#2x.png" alt="">
</div>
</div>
<div class="fbox-content ">
<h3 class="ourservice-heading">RELIABLE INVESTMENT</h3>
<div class="description">Investments worth 37 Billion AED from Gulf residents. Total transactions reached 111 Billion in Dubai 2018.</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
.description {
margin: 0 0 20px 0;
}
.icon-inner{
background:#fff !important;
box-shadow:none;
}
#media only screen and (max-width: 767px) {
.col-xs-12 {
padding: 0px 14%;
}
}
#media only screen and (min-width: 768px) {
.col-sm-6 {
height: 240px;
width: 25%;
margin: 23px 12%;
background: whitesmoke;
box-shadow: 2px 2px 30px -6px #8e99a3;
margin-bottom: 80px;
}
.box-model {
position: absolute;
top: -95px;
left: 10%;
width: 80%;
}
.box-align1{
right:-80px !important;
}
.box-align2{
left:-80px !important;
}
.title{
margin-bottom:80px !important;
}
}
#media only screen and (min-width: 992px) {
.col-sm-6 {
height: 238px;
width: 25%;
margin: 23px 12%;
background: whitesmoke;
box-shadow: 2px 2px 30px -6px #8e99a3;
margin-bottom: 90px;
}
.box-model {
position: absolute;
top: -95px;
left: 10%;
width: 80%;
}
.box-align1{
right:-105px !important;
}
.box-align2{
left:-105px !important;
}
.title{
margin-bottom:80px !important;
}
}
#media only screen and (min-width: 1141px) {
.col-sm-6 {
width: 25%;
margin: 23px 12%;
background: whitesmoke;
box-shadow: 2px 2px 30px -6px #8e99a3;
height: 230px !important;
margin-bottom: 100px;
}
.box-model {
position: absolute;
top: -95px;
width: 80%;
left: 10%;
}
.box-align1{
right:-126px !important;
}
.box-align2{
left:-126px !important;
}
.title{
margin-bottom:80px !important;
}
}
#media only screen and (min-width: 1141px) {
.box-align1{
right:-114px !important;
}
.box-align2{
left:-114px !important;
}
}
#media only screen and (min-width: 1200px) {
.box-align1{
right:-125px !important;
}
.box-align2{
left:-125px !important;
}
}
#media only screen and (min-width: 1290px) {
.box-align1{
right:-162px !important;
}
.box-align2{
left:-162px !important;
}
}
</style>

Bootstrap columns shrink instead of stacking

On my landing page, we have a "Media Resource" section with links to videos, support materials and social media. Currently, the content in the section shrinks when the window is resized rather than the wanted outcome of stacking.
To be clear, the Videos, Support, and Social are what should be stacking. The heading of the section is perfectly fine.
I've looked through the HTML and CSS for the section but can't seem to pinpoint what's causing them not to stack like desired. Below is the HTML and CSS for what's being worked on.
HTML
<div class="container-fluid no-gutters media-resource-wrapper">
<div class="row">
<div class="col-12 col-lg-4 text-center">
<h2 class="boxheader-lead">Media & Public Relations Resource Center</h2>
</div>
<div class="col-3 col-lg-2">
<img src="~/Images/Video.png" alt="videos" class="img-fluid media-icon video" />
</div>
<div class="col-6 col-lg-4">
<img src="~/Images/Materials.png" alt="support materials" class="img-fluid" />
</div>
<div class="col-3 col-lg-2">
<img src="~/Images/Social.png" alt="social" class="img-fluid media-icon social" />
</div>
</div>
</div>
CSS
.media-resource-wrapper {
background-color: #00b9f2;
padding: 60px 0;
}
.media-resource-wrapper > .row {
margin: 0 10px;
}
.media-resource-wrapper h2 {
margin-bottom: 30px;
color: #fff;
font-weight: bold;
n-bottom: 30px;
color: #fff;
font-weight: bold;
}
/* Media resourse icon positioning */
.media-resource-wrapper .media-icon {
position: relative;
top: 20px;
}
#media (min-width: 992px) {
.health-professionals-block .boxheader-landing {
left: 30px;
margin-top: 250px;
width: 20%;
}
.boxheader-landing h1, .boxheader-landing h2 {
font-size: 1.75em;
}
.boxheader-landing-copy {
font-size: .9em;
}
.media-resource-wrapper h2 {
margin-top: 40px;
border-right: 1px solid #fff;
padding-right: 30px;
}
.media-resource-wrapper .media-icon {
top: 30px;
}
.media-resource-wrapper {
padding: 60px 0 60px 0;
}
}
UPDATE
I made a change that was recommended but the images below shows how it looks by default and then when I shrink.
Standard Size:
Smaller window:
Use standard bootstrap class col-sm-3 and col-sm-6.
Replace the URL with your image and it will stack.
.media-resource-wrapper {
background-color: #00b9f2;
padding: 60px 0;
}
.media-resource-wrapper>.row {
margin: 0 10px;
}
.media-resource-wrapper h2 {
margin-bottom: 30px;
color: #fff;
font-weight: bold;
n-bottom: 30px;
color: #fff;
font-weight: bold;
}
/* Media resourse icon positioning */
.media-resource-wrapper .media-icon {
position: relative;
top: 20px;
}
#media (min-width: 992px) {
.health-professionals-block .boxheader-landing {
left: 30px;
margin-top: 250px;
width: 20%;
}
.boxheader-landing h1,
.boxheader-landing h2 {
font-size: 1.75em;
}
.boxheader-landing-copy {
font-size: .9em;
}
.media-resource-wrapper h2 {
margin-top: 40px;
border-right: 1px solid #fff;
padding-right: 30px;
}
.media-resource-wrapper .media-icon {
top: 30px;
}
.media-resource-wrapper {
padding: 60px 0 60px 0;
}
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-beta.2/css/bootstrap.css" rel="stylesheet" />
<div class="container-fluid no-gutters media-resource-wrapper">
<div class="row">
<div class="col-sm-12 col-lg-4 text-center">
<h2 class="boxheader-lead">Media & Public Relations Resource Center</h2>
</div>
<div class="col-sm-3 col-lg-2">
<img src="https://lh3.googleusercontent.com/gN6iBKP1b2GTXZZoCxhyXiYIAh8QJ_8xzlhEK6csyDadA4GdkEdIEy9Bc8s5jozt1g=w300" alt="videos" class="img-fluid media-icon video" />
</div>
<div class="col-sm-6 col-lg-4">
<img src="https://lh3.googleusercontent.com/gN6iBKP1b2GTXZZoCxhyXiYIAh8QJ_8xzlhEK6csyDadA4GdkEdIEy9Bc8s5jozt1g=w300" alt="support materials" class="img-fluid" />
</div>
<div class="col-sm-3 col-lg-2">
<img src="https://lh3.googleusercontent.com/gN6iBKP1b2GTXZZoCxhyXiYIAh8QJ_8xzlhEK6csyDadA4GdkEdIEy9Bc8s5jozt1g=w300" alt="social" class="img-fluid media-icon social" />
</div>
</div>
</div>
<div class="container-fluid no-gutters media-resource-wrapper">
<div class="row">
<div class="col-12 text-center">
<h2 class="boxheader-lead">Media & Public Relations Resource
Center</h2>
</div>
</div>
<div class="row">
<div class="col-3 ">
<img src="~/Images/Video.png" alt="videos" class="img-fluid media-
icon video" />
</div>
<div class="col-6 ">
<img src="~/Images/Materials.png" alt="support materials"
class="img-fluid" />
</div>
<div class="col-3 ">
<img src="~/Images/Social.png" alt="social" class="img-fluid
media-icon social" />
</div>
</div>
If you want the columns to stack use col-sm- instead...
https://www.codeply.com/go/kQHOYSTEnL
<div class="container-fluid no-gutters media-resource-wrapper">
<div class="row">
<div class="col-12 col-lg-4 text-center">
<h2 class="boxheader-lead">Media & Public Relations Resource Center</h2>
</div>
<div class="col-sm-3 col-lg-2">
<img src="//placehold.it/200" alt="videos" class="img-fluid media-icon video" />
</div>
<div class="col-sm-6 col-lg-4 text-center">
<img src="//placehold.it/200" alt="support materials" class="img-fluid" />
</div>
<div class="col-sm-3 col-lg-2">
<img src="//placehold.it/200" alt="social" class="img-fluid media-icon social" />
</div>
</div>
</div>
As you can see here, the .col- is the smallest breakpoint, so they will continue to shrink horizontally in width. sm is the next size up so they will become full-width, and stack vertically at 576px. If you want the cols to stack at wider widths use col-md-,col-lg- or col-xl-, etc..
<div class="container-fluid no-gutters media-resource-wrapper">
<div class="row">
<div class="col-12 text-center">
<h2 class="boxheader-lead">Media & Public Relations Resource Center</h2>
</div>
<div class="col-3 ">
<img src="~/Images/Video.png" alt="videos" class="img-fluid media-icon video" />
</div>
<div class="col-6 ">
<img src="~/Images/Materials.png" alt="support materials" class="img-fluid" />
</div>
<div class="col-3 ">
<img src="~/Images/Social.png" alt="social" class="img-fluid media-icon social" />
</div>
</div>

How to vertically align the items in the div?

.features {
background-color: #0375b4;
padding: 40px 100px;
float: left;
width: 100%;
}
.features img {
width: 100px;
}
.features-content {
text-align: center;
}
.features-content h1 {
font-size: 24px;
color: #ffffff;
text-transform: uppercase;
margin-top: 10px;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="features">
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="features-content">
<img src="https://image.flaticon.com/teams/slug/freepik.jpg" alt="Compass Logo">
<h1>Adventure</h1>
</div>
</div>
<div class="col-sm-4">
<div class="features-content">
<img src="https://image.flaticon.com/teams/slug/freepik.jpg" alt="Compass Logo">
<h1>Fun & Safety</h1>
</div>
</div>
<div class="col-sm-4">
<div class="features-content">
<img src="https://image.flaticon.com/teams/slug/freepik.jpg" alt="Compass Logo">
<h1>Impeccable Service</h1>
</div>
</div>
</div>
</div>
</div>
The items in the div are not vertically aligned . How do I properly align the items in the middle of the div? The picture in the last div is smaller than the pictures in other div so it has gone up. how to put all the pictures in the middle?
This can be achieved by specifying the desired image height (that of the other two images) to the img dom element.
In this case, we apply the following CSS rules to .features-content img
.features-content img {
object-fit: none;
width: 100%;
height: 150px;
}
Complete example
.features {
background-color: #0375b4;
padding: 40px 100px;
float: left;
width: 100%;
}
.features img {
width: auto;
}
.features-content {
text-align: center;
}
.features-content h1 {
font-size: 24px;
color: #ffffff;
text-transform: uppercase;
margin-top: 10px;
}
.features-content img {
object-fit: none;
width: 100%;
height: 150px;
}
<!-- Latest compiled and minified Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="features">
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="features-content">
<img src="http://via.placeholder.com/150x150" alt="Compass Logo">
<h1>Adventure</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="http://via.placeholder.com/150x150" alt="Compass Logo">
<h1>Fun & Safety</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="http://via.placeholder.com/150x100" alt="Compass Logo">
<h1>Impeccable Service</h1>
</div>
</div>
</div>
</div>
</div>
Click the full screen button on the upper-right portion of the code snippet in order to see a wider view with items side-by-side; as shown in your example screenshot.
you can use following css property -
vertical-align: middle;
You can check in detail on here
Add vertical-align for images, and margin:0 auto; for div container.
.features{
background-color: #0375b4;
padding:40px 100px;
float: left;
width: 100%;
}
img{
width: auto;
vertical-align:middle;
}
.features-content{
text-align: center;
width:100%;
display:inline-block;
margin:0 auto;
}
.features-content h1{
font-size:12px;
margin:0;
text-transform: uppercase;
}
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="features-content">
<img src="images/compass.png" alt="Compass Logo">
<h1>Adventure</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="images/tube.png" alt="Compass Logo">
<h1>Fun & Safety</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="images/diamond.png" alt="Compass Logo">
<h1>Impeccable Service</h1>
</div>
</div>
</div>
</div>
If you are using Bootstrap 4 just add d-flex align-items-center to row class to align vertically center.
In your case,
the third column h1 text length is grater when compare to other two so there is some issue in the design.
features{
background-color: #0375b4;
padding:40px 100px;
float: left;
width: 100%;
}
.features img{
width: auto;
}
.features-content{
text-align: center;
}
.features-content h1{
font-size: 24px;
color: #000;
text-transform: uppercase;
margin-top: 10px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet"/>
<div class="features">
<div class="container">
<div class="row d-flex align-items-center">
<div class="col-md-4">
<div class="features-content">
<img src="https://dummyimage.com/70x70/000/fff" alt="Compass Logo">
<h1>Adventure</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="https://dummyimage.com/70x70/000/fff" alt="Compass Logo">
<h1>Fun & Safety</h1>
</div>
</div>
<div class="col-md-4">
<div class="features-content">
<img src="https://dummyimage.com/70x70/000/fff" alt="Compass Logo">
<h1>Impeccable Service</h1>
</div>
</div>
</div>
</div>
</div>

How to remove space between section tags

I'm having some trouble removing the space between the two sections of my code.
Here is the JSFiddle of my code.
/********************Intro**********************/
.intro-content {
padding-top: 250px;
}
.intro-content h1 {
font-family: "Arial Black";
font-weight: bolder;
}
#typed {
font-family: monospace;
font-size: 20px;
}
.button {
padding-top: 50px;
}
.button button {
background-color: black;
border-color: black;
border-radius: 25px;
color: white;
font-weight: bolder;
margin-bottom: 22%;
}
/********************Intro*********************/
/********************Contact*********************/
#about {
background-color: lightgray;
}
#skill {
background-color: lightblue;
}
#intro-section {
background-color: lightgreen;
}
.contact-info h4 {
font-family: "Arial Black";
font-weight: bolder;
}
.contact-icon {
padding-top: 50px;
}
.contact-block {
padding-top: 20px;
align-content: center;
margin-left: 5%;
}
.aboutme h1 {
padding-top: 50px;
margin-left: 50px;
font-family: "Arial Black";
font-size: 50px;
color: black;
font-weight: bolder;
text-shadow: 2px 2px darkgray;
}
.my-contact .contact-info {
display: table-cell;
font-size: 18px;
}
.my-contact .contact-icon span {
font-size: 20px;
margin-right: 15px;
float: left;
margin-top: 25px;
}
.contact-summary {
padding-top: 70px;
font-style: italic;
font-size: 20px;
}
.contact-developer {
padding-top: 95px;
margin-bottom: 7%;
font-size: 15px;
font-weight: bold;
}
/********************Contact*********************/
<!----------------------Intro-------------------------------->
<section id="intro-section" class="intro">
<div class="intro-content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 text-center">
<h1>HELLO, I'M ERIC.</h1>
<div id="typed-strings">
<p>Welcome to my personal website!</p>
<p>UI DESIGNER / WEB DEVELOPER</p>
</div>
<span id="typed"></span>
<div class="button">
<button>GET IN TOUCH</button>
</div>
</div>
</div>
</div>
</div>
</section>
<!----------------------Intro----------------------------->
<!----------------------Contact----------------------------->
<section id="about" class="aboutme">
<h1>ABOUT ME</h1>
<div class="container-fluid">
<div class="contact-block clearfix">
<div class="row">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="contact-summary">
<p>Welcome to my personal website! My name is Eric Holdridge. I'm a web developer and UI designer. I have been web developing for 2 years.
I love creating beautiful and responsive websites for anyone. Most web designers won't put in the time and effort to create a
fully functional website. If you have an idea, I will make it happen. You can reach me at
one of my contact options below.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-user"></span>
<div class="contact-info">
<h4>Name:</h4>
<p>Eric</p>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-envelope"></span>
<div class="contact-info">
<h4>Email:</h4>
<p>e#gmail.com</p>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-phone"></span>
<div class="contact-info">
<h4>Phone:</h4>
<p>(563)</p>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-calendar"></span>
<div class="contact-info">
<h4>Date of Birth:</h4>
<p>April</p>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-globe"></span>
<div class="contact-info">
<h4>Location:</h4>
<p></p>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-flag"></span>
<div class="contact-info">
<h4>Nationality:</h4>
<p>United States</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="contact-developer">
<p>CREATIVE FRONT-END AND BACK-END DEVELOPER.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!----------------------Contact----------------------------->
That's the margin on your h1's collapsing outside of the parent. There are a bunch of ways to fix it, so I just removed the top margin on h1.
Here's a resource - https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing
If there is no border, padding, inline content, block_formatting_context created or clearance to separate the margin-top of a block from the margin-top of its first child block, or no border, padding, inline content, height, min-height, or max-height to separate the margin-bottom of a block from the margin-bottom of its last child, then those margins collapse. The collapsed margin ends up outside the parent.
/********************Intro**********************/
.intro-content {
padding-top: 250px;
}
.intro-content h1 {
font-family: "Arial Black";
font-weight: bolder;
}
#typed {
font-family: monospace;
font-size: 20px;
}
.button {
padding-top: 50px;
}
.button button {
background-color: black;
border-color: black;
border-radius: 25px;
color: white;
font-weight: bolder;
margin-bottom: 22%;
}
/********************Intro*********************/
/********************Contact*********************/
#about {
background-color: lightgray;
}
#skill {
background-color: lightblue;
}
#intro-section {
background-color: lightgreen;
}
.contact-info h4 {
font-family: "Arial Black";
font-weight: bolder;
}
.contact-icon {
padding-top: 50px;
}
.contact-block {
padding-top: 20px;
align-content: center;
margin-left: 5%;
}
.aboutme h1 {
padding-top: 50px;
margin-left: 50px;
font-family: "Arial Black";
font-size: 50px;
color: black;
font-weight: bolder;
text-shadow: 2px 2px darkgray;
}
.my-contact .contact-info {
display: table-cell;
font-size: 18px;
}
.my-contact .contact-icon span {
font-size: 20px;
margin-right: 15px;
float: left;
margin-top: 25px;
}
.contact-summary {
padding-top: 70px;
font-style: italic;
font-size: 20px;
}
.contact-developer {
padding-top: 95px;
margin-bottom: 7%;
font-size: 15px;
font-weight: bold;
}
/********************Contact*********************/
h1 {
margin-top: 0;
}
<!----------------------Intro-------------------------------->
<section id="intro-section" class="intro">
<div class="intro-content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 text-center">
<h1>HELLO, I'M ERIC.</h1>
<div id="typed-strings">
<p>Welcome to my personal website!</p>
<p>UI DESIGNER / WEB DEVELOPER</p>
</div>
<span id="typed"></span>
<div class="button">
<button>GET IN TOUCH</button>
</div>
</div>
</div>
</div>
</div>
</section>
<!----------------------Intro----------------------------->
<!----------------------Contact----------------------------->
<section id="about" class="aboutme">
<h1>ABOUT ME</h1>
<div class="container-fluid">
<div class="contact-block clearfix">
<div class="row">
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="contact-summary">
<p>Welcome to my personal website! My name is Eric Holdridge. I'm a web developer and UI designer. I have been web developing for 2 years.
I love creating beautiful and responsive websites for anyone. Most web designers won't put in the time and effort to create a
fully functional website. If you have an idea, I will make it happen. You can reach me at
one of my contact options below.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-user"></span>
<div class="contact-info">
<h4>Name:</h4>
<p>Eric</p>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-envelope"></span>
<div class="contact-info">
<h4>Email:</h4>
<p>e#gmail.com</p>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-phone"></span>
<div class="contact-info">
<h4>Phone:</h4>
<p>(563)</p>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-calendar"></span>
<div class="contact-info">
<h4>Date of Birth:</h4>
<p>April</p>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-globe"></span>
<div class="contact-info">
<h4>Location:</h4>
<p></p>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<div class="my-contact clearfix">
<div class="contact-icon">
<span class="glyphicon glyphicon-flag"></span>
<div class="contact-info">
<h4>Nationality:</h4>
<p>United States</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12">
<div class="contact-developer">
<p>CREATIVE FRONT-END AND BACK-END DEVELOPER.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!----------------------Contact----------------------------->

color overlay images styling effect with text

im trying to create a overlay color to my images products, basically the overlay color will appear when i make hover to the images, but isnt working.
The idea is when i pass the mouse over the images a transparecy the title and price appears with the overlay color
Here is my code:
html:
<!-- List of products -->
<div id="products" class="row list-group">
<div class="item col-xs-4 col-lg-4">
<div class="thumbnail">
<img class="group list-group-image" src="images/products/1.png" alt="" />
<div class="caption">
<h4 class="group inner list-group-item-heading">
Product title</h4>
<div class="row go-bottom">
<div class="col-xs-12">
<p class="price">
80 € / 120 €</p>
</div>
</div>
</div>
</div>
</div>
<div class="item col-xs-4 col-lg-4">
<div class="thumbnail">
<img class="group list-group-image" src="images/products/1.png" alt="" />
<div class="caption">
<h4 class="group inner list-group-item-heading">
Product title</h4>
<div class="row go-bottom">
<div class="col-xs-12">
<p class="price">
80 € / 120 €</p>
</div>
</div>
</div>
</div>
</div>
<div class="item col-xs-4 col-lg-4">
<div class="thumbnail overlay">
<img class="group list-group-image" src="images/products/1.png" alt="" />
<div class="caption">
<h4 class="group inner list-group-item-heading">
Color Gold
</h4>
<div class="row go-bottom">
<div class="col-xs-12">
<p class="price">
80 € / 120 €</p>
</div>
</div>
</div>
</div>
</div>
</div>
css:
.thumbnail:after {
content:'\A';
position:absolute;
width:100%; height:100%;
top:0; left:0;
background:rgba(0,0,0,0.6);
opacity:0;
transition: all 0.5s;
-webkit-transition: all 0.5s;
}
.thumbnail:hover:after {
opacity:1;
}
.list-group-item:hover{
background:rgba(0,0,0,.7);
}
.shop-products .item .thumbnail{
border:none;
padding:0;
position: relative;
}
.shop-products .item .thumbnail .caption{
position: absolute;
bottom:0;
width: 100%;
height: 100%;
text-align: center;
}
h4.list-group-item-heading{
text-transform: uppercase;
font-weight: bold;
color:red;
letter-spacing: 3px;
}
.shop-products .item .thumbnail .caption .price{
color:red;
font-size:16px;
letter-spacing: 3px;
}
.go-bottom{
bottom:0px;
position: absolute;
width: 100%;
}
I'm not able to find the class list-group-item inside your code.
the caption should have the background-color.
.shop-products .item .thumbnail .caption{
position: absolute;
bottom:0;
left:0;
width: 100%;
height: 100%;
text-align: center;
display:none;
background:rgba(0,0,0,.7);
}
.shop-products .item .thumbnail:hover .caption{
display:block;
}