I've searched and tried all Stackoverflow solutions without success.
I've this code and I'm using bootstrap3
<footer>
<div class="container">
<div class="row">
<div class="col-md-4">
<img src="Images/social/facebook.png" alt="facebook" class="footerimg" />
<img src="Images/social/twitter.png" alt="twitter" class="footerimg" />
<img src="Images/social/youtube.png" alt="youtube" class="footerimg" />
</div>
<div class="col-md-4 col-md-offset-4">
<p class="text-right">© <%: DateTime.Now.Year %> Test - All Rights Reserved</p><p class="text-right">P.IVA 123456789</p>
</div>
</div>
</div>
</footer>
I would like to vertically center col-md-4 elements and I have footer styles like this:
footer {
background-color: #000;
color: #fff;
height: 120px;
}
I've already tried with table-cell applied to col-md-4 but without success.
Can you suggest a solution?
If you want something like this : (images are not shown)
I made a live example.
This is the code :
<footer>
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-4">
<div class="centered">
<img src="Images/social/facebook.png" alt="facebook" class="footerimg" />
<img src="Images/social/twitter.png" alt="twitter" class="footerimg" />
<img src="Images/social/youtube.png" alt="youtube" class="footerimg" />
</div>
</div>
<div class="col-md-4 col-sm-4 col-sm-offset-4 col-md-offset-4">
<div class="centered">
<p class="text-right">© Test - All Rights Reserved</p><p class="text-right">P.IVA 123456789</p>
</div>
</div>
</div>
</div>
</footer>
And the CSS
footer {
background-color: #000;
color: #fff;
height: 120px;
display: table;
width: 100%;
}
.centered {
display: table-cell;
vertical-align: middle;
height: 120px;
}
Ref : centering-in-the-unknown
Related
I want to set all the images in center and five image in first row and rest of the images in second row in center. I tried the following code.
<section id="Section">
<h1 class="sectionTitle text-center">Images</h1>
<div class="row center" id="Logo">
<!-- All logo from firestore -->
</div>
</section>
I am using firestore here is my JavaScript code:
db.collection('images').orderBy('image').onSnapshot((snapshot) => {
//insertHtml("#main-content", response);
snapshot.docs.forEach(doc => {
var brand = '<div class="column">'
+ '<img src="images/'+ doc.data().image + '"></div>';
$("#Logo").append(brand);
});
});
here is my css code:
#Section .center {
display: block;
margin-left: auto;
margin-right: auto;
width: 80%;
}
#Section .row .column {
float: left;
width: 20%;
}
#Section .row .column img{
max-height: 115px;
max-width: 210px;
}
There are 8/9 images, so first row works well, but 2nd row is not in center. I want to fix it. How can I do it ?
Use display flex and change the flex-basis to 100/number of elements like so :
#Section .center {
display: flex;
margin-left: auto;
margin-right: auto;
justify-content : center;
align-items : center;
flex-wrap : wrap;
column-gap : 15px;
row-gap : 15px;
width: 80%;
}
.logos {
text-align : center;
flex-basis : calc(20% - 15px);
background-color : red;
]
<section id="Section">
<h1 class="sectionTitle text-center">Images</h1>
<div class="row center" id="Logo">
<div class="logos"> 1 </div>
<div class="logos"> 2 </div>
<div class="logos"> 3 </div>
<div class="logos"> 4 </div>
<div class="logos"> 5 </div>
<div class="logos"> 6 </div>
<div class="logos"> 7 </div>
<div class="logos"> 8 </div>
<div class="logos"> 9 </div>
</div>
</section>
You can use
For the alignment of all elements horizontally
<div class="row justify-content-center" id="Logo">
<div class="col-md-*"> 1 logo </div>
<div class="col-md-*"> 2 logo </div>
<div class="col-md-*"> 3 logo </div>
<div class="col-md-*"> 4 logo </div>
<div class="col-md-*"> 5 logo </div>
</div>
<div class="row justify-content-center" id="Logo">
<div class="col-md-4"> 1 logo </div>
<div class="col-md-4"> 2 logo </div>
<div class="col-md-4"> 3 logo </div>
</div>
Is this what you need?
[example
.container {
display: flex;
flex: 1;
flex-wrap: wrap;
}
.item {
width: 200px;
height: 50px;
background: pink;
margin: 20px;
display: flex;
justify-content: center;
}
img {
width: 40px;
background: teal;
}
<div class="container">
<div class="item">
<img src="" alt="1" />
</div>
<div class="item">
<img src="" alt="1" />
</div>
<div class="item">
<img src="" alt="1" />
</div>
<div class="item">
<img src="" alt="1" />
</div>
<div class="item">
<img src="" alt="1" />
</div>
<div class="item">
<img src="" alt="1" />
</div>
<div class="item">
<img src="" alt="1" />
</div>
<div class="item">
<img src="" alt="1" />
</div>
<div class="item">
<img src="" alt="1" />
</div>
</div>
I'm trying to align 6 images in one row with bootstrap but I get only 4 images with a big space between them. I'm not a professional with CSS.
Here is my HTML Code
<html>
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<style>
.container-best
{
width:70%;
text-align:center;
margin: auto;
}
.best-rate
{
background-color: #ffd564;
text-align: center;
font: 20px 'aleobold', sans-serif;
color: #4c4145;
text-transform: uppercase;
padding-bottom: 25px;
padding-top: 26px;
position: relative;
}
</style>
</head>
<body>
<div class="container">
<div class="container-best">
<div class="best-rate">
☆☆☆☆☆☆☆Today Best Choice☆☆☆☆☆☆☆
</div>
</div>
<br />
<div class="row">
<div class="col-md-2 col-md-offset-1">
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/mercenaries.jpg">
</div>
<div class="col-md-2 col-md-offset-1" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/Narco-Valley.jpg">
</div>
<div class="col-md-2 col-md-offset-1" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/Vikingdom.jpg" >
</div>
<div class="col-md-2 col-md-offset-1" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/Red-Dirt-Rising.jpg" >
</div>
<div class="col-md-2 col-md-offset-1" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/At-All-Cost.jpg" >
</div>
<div class="col-md-2 col-md-offset-1" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/mercenaries.jpg" >
</div>
</div>
<div>
</body>
</html>
I tried to fix many times but I failed, I don't know what is the problem, Please help.
Thanks in advance
first, add CSS class,
.img-responsive{
width: 100%;
}
remove the "col-md-offset-1" in div tag. And add images into the .
<div class="container">
<div class="row">
<div class="col-md-2">
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/mercenaries.jpg">
</div>
<div class="col-md-2" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/Narco-Valley.jpg">
</div>
<div class="col-md-2" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/Vikingdom.jpg" >
</div>
<div class="col-md-2" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/Red-Dirt-Rising.jpg" >
</div>
<div class="col-md-2" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/At-All-Cost.jpg" >
</div>
<div class="col-md-2" >
<img class="img-responsive" src="https://www.linkedfilm.com/upload/photos/2019/01/mercenaries.jpg" >
</div>
</div>
</div>
You need to remove col-md-offset-1 from columns and it will fix the problem. Bootstrap has a 12 column layout. You have to many columns in a row: 6*2 (from columns) + 6*1 (from offset) = 18.
I'm trying to make circular images on a page but I wanted them to be the same size and try to keep the aspect ratio. Since they are different sizes, it looks horrible. I wanted to make them look like the yellow guy image.
.person {
border: 10px solid transparent;
margin-bottom: 25px;
width: auto;
height: 200px;
position: relative;
background-repeat: no-repeat;
background-size: cover;
opacity: 0.7;
border-radius: 50%;
}
.person:hover {
opacity: 1;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container text-center">
<div class="row">
<div class="col-sm-4">
<p><strong>Counter-Strike</strong></p>
<br />
<a href="">
<img class="person" src="http://i.imgur.com/Zckhfao.jpg" />
</a>
</div>
<div class="col-sm-4">
<p><strong>Rainbow 6: Siege</strong></p>
<br />
<img class="img-circle person" src="http://i.imgur.com/Dho2UVH.png" />
</div>
<div class="col-sm-4">
<p><strong>FIFA</strong></p>
<br />
<img class="person" src="http://i.imgur.com/Dho2UVH.png" />
</div>
</div>
<div class="row">
<div class="col-sm-4">
<p><strong>League of Legends</strong></p>
<br />
<img class="person" src="http://i.imgur.com/Dho2UVH.png" />
</div>
<div class="col-sm-4">
<p><strong>Racing</strong></p>
<br />
<img class="person" src="http://i.imgur.com/Dho2UVH.png" />
</div>
<div class="col-sm-4">
<p><strong>Battlefield</strong></p>
<br />
<img class="person" src="http://i.imgur.com/bFg40Dj.jpg" />
</div>
</div>
</div>
you might need to apply height:auto and max-width: 100%; to you img
.person {
border: 10px solid transparent;
margin-bottom: 25px;
width: auto;
height: 200px;
position: relative;
background-repeat: no-repeat;
background-size: cover;
opacity: 0.7;
border-radius: 50%;
}
.person:hover {
opacity: 1;
}
.myrow img{
height:auto;
max-width: 100%;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container text-center">
<div class="row myrow">
<div class="col-sm-4">
<p><strong>Counter-Strike</strong></p><br />
<a href=#Url.Action( "PC", "Gaming")>
<img class="person" src="https://baconmockup.com/300/200/" />
</a>
</div>
<div class="col-sm-4">
<p><strong>Rainbow 6: Siege</strong></p><br />
<img class="img-circle person" src="https://baconmockup.com/300/200/" />
</div>
<div class="col-sm-4">
<p><strong>FIFA</strong></p><br />
<img class="person" src="https://baconmockup.com/300/200/" />
</div>
</div>
<div class="row">
<div class="col-sm-4">
<p><strong>League of Legends</strong></p><br />
<img class="person" src="https://i.ytimg.com/vi/zrwRmR6MKeg/maxresdefault.jpg" />
</div>
<div class="col-sm-4">
<p><strong>Racing</strong></p><br />
<img class="person" src="https://i.ytimg.com/vi/zrwRmR6MKeg/maxresdefault.jpg" />
</div>
<div class="col-sm-4">
<p><strong>Battlefield</strong></p><br />
<img class="person" src="https://i.ytimg.com/vi/zrwRmR6MKeg/maxresdefault.jpg" />
</div>
</div>
</div>
If you want to keep your image in an img tag, you can use the object-fit property to force the image to adapt to its container. You might also need a polyfill for browser support, I suggest the lazysizes plugin.
You might also define your images with a background-image (directly set in a style attribute, so it can be managed from the view...) and use the more supported background-size property. Some lazyload plugins (see http://jquery.eisbehr.de/lazy/example_load-background-images for instance) offer this approach with a data-src attribute.
In both case the cover value seems, as you suggested, the right value to use with object-fit or background-size.
You can add max-width: 100% and max-height: 200px for your images to preserve aspect ratio but take not more than 200px or height. Demo:
.person {
border: 10px solid transparent;
margin-bottom: 25px;
max-width: 100%;
max-height: 200px;
position: relative;
background-repeat: no-repeat;
background-size: cover;
opacity: 0.7;
border-radius: 50%;
}
.person:hover {
opacity: 1;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container text-center list">
<div class="row">
<div class="col-sm-4">
<p><strong>Counter-Strike</strong></p>
<br />
<a href="">
<img class="person" src="http://i.imgur.com/Zckhfao.jpg" />
</a>
</div>
<div class="col-sm-4">
<p><strong>Rainbow 6: Siege</strong></p>
<br />
<img class="img-circle person" src="http://i.imgur.com/Dho2UVH.png" />
</div>
<div class="col-sm-4">
<p><strong>FIFA</strong></p>
<br />
<img class="person" src="http://i.imgur.com/Dho2UVH.png" />
</div>
</div>
<div class="row">
<div class="col-sm-4">
<p><strong>League of Legends</strong></p>
<br />
<img class="person" src="http://i.imgur.com/Dho2UVH.png" />
</div>
<div class="col-sm-4">
<p><strong>Racing</strong></p>
<br />
<img class="person" src="http://i.imgur.com/Dho2UVH.png" />
</div>
<div class="col-sm-4">
<p><strong>Battlefield</strong></p>
<br />
<img class="person" src="http://i.imgur.com/bFg40Dj.jpg" />
</div>
</div>
</div>
I have two section on a page. I am not able to vertically align their contents. I am using vertical-align:middle yet unable to do it. I have also tried display:flex but that creates problem in responsive view.
Here is the structure:
<div class="container-fluid" style="display:table;width:100%;">
<div class="row" style="display: table-cell;vertical-align:middle;">
<div class="col-lg-9 section_1">
<div class="logo hidden-xs">
<img src="custom_images/logo.png" />
</div>
<div class="realtor">
<img src="custom_images/realtors-profileimg.png" width="70" height="70" />
</div>
<div class="name & number">
<span>Sohil shah</span>
<span>+91-972-255-2874</span>
</div>
<div class="moving_companies hidden-xs">Find Moving Companies in Chicago, IL 1-8444-4Move-EZ</div>
<div class="phone_number hidden-xs">080-888-0888</div>
<<div class="powered_by hidden-xs">
<img src="custom_images/powerdby-logo.png" />
</div>
</div>
<div class="col-lg-3 section_2" style="height:70px;">
<!--<button class="login">Login<i class="fa fa-caret"></i></button>-->
<div class="logo">
<img src="custom_images/logo.png" />
</div>
<div class="name & number">
<span>Sohil shah</span>
<span>+91-972-255-2874</span>
</div>
</div>
</div>
</div>
and the style is here....
.row > div
{
display: table-cell;
vertical-align: middle;
}
.section_1 > div
{
display: inline-block;
}
.section_2 > div
{
display: inline-block;
}
img
{
max-width: 100%;
max-height: 100%;
}
and here is the screen shot of the problem...
You had error in HTML <<div class="powered_by hidden-xs">
Here is fixed version https://jsfiddle.net/kjp91hko/2/
<div class="container-fluid" style="display:table;width:100%;">
<div class="row" style="display: table-cell;vertical-align:middle;">
<div class="col-lg-9 section_1">
<div class="logo hidden-xs">
<img src="custom_images/logo.png" />
</div>
<div class="realtor">
<img src="custom_images/realtors-profileimg.png" width="70" height="70" />
</div>
<div class="name & number">
<span>Sohil shah</span>
<span>+91-972-255-2874</span>
</div>
<div class="moving_companies hidden-xs">Find Moving Companies in Chicago, IL 1-8444-4Move-EZ</div>
<div class="phone_number hidden-xs">080-888-0888</div>
<div class="powered_by hidden-xs">
<img src="custom_images/powerdby-logo.png" />
</div>
</div>
<div class="col-lg-3 section_2" style="height:70px;">
<!--<button class="login">Login<i class="fa fa-caret"></i></button>-->
<div class="logo">
<img src="custom_images/logo.png" />
</div>
<div class="name & number">
<span>Sohil shah</span>
<span>+91-972-255-2874</span>
</div>
</div>
</div>
</div>
I have dynamic div boxes created in a website, I want to have 4 boxes in each row using bootstrap, that's working, but each box has some text at the bottom, the problem is that when the text is too long and it creates a new line, the div expands but the box underneath this div moves to the right, instead of moving all the row underneath down.
This is the html:
<div class="row">
<div ng-repeat=""class="col-sm-3 album-art"> //loop to create the boxes
<div class="thumb">
<div class="box">
<span class="play" ng-click="">►</span>
<div class="overlay"></div>
</div>
<img src= height="200" width="200">
<p>text</p>
<p><i>text</i></p>
</div>
</div>
And this is the css I have:
.album-art{
padding-bottom: 20px;
padding-top: 20px;
margin-bottom: 10px;
}
.thumb {
position: relative;
}
.thumb .box {
position: absolute;
top: 0;
display: block;
width: 200px;
height: 200px;
text-align: center;
text-decoration: none;
cursor: pointer;
}
Basically what I'd need is that when the text overflows and creates a new line, the row below the current row moves down and not move every element to the right.The problem seems to be in the "album-art" class, since I removed all the other classes and the problem still there.
thanks
EDIT: I've added images for a better explanation
This is when everything is normal
But when the text is longer
EDIT2: I put an example here: jsfiddle.net/qgo7a701 you might have to expand the result area to the left in order to see 4 squares per row
I don't understand you question very well , but in bootstrap the row divided to 12 cell, and you can define divs in row with different sizes.and you can use col-[xl,lg,md,sm,xs]-[1 to 12] classes for that. you can look to this link :
http://getbootstrap.com/examples/grid/
for you example below i have tried to make two row with two boxes and i only break the text to prevent it to overflow to next div
.album-art{
padding-bottom: 20px;
padding-top: 20px;
margin-bottom: 10px;
}
p{
word-break: break-all;
}
.thumb {
position: relative;
}
.thumb .box {
position: absolute;
top: 0;
display: block;
width: 200px;
height: 200px;
text-align: center;
text-decoration: none;
cursor: pointer;
}
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<div class="row">
<div ng-repeat=""class="col-sm-3 album-art">
//loop to create the boxes
<div class="thumb">
<div class="box">
<span class="play" ng-click="">►</span>
<div class="overlay">
</div>
</div>
<img src= height="200" width="200"/>
<p style="">text helooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo</p>
<p><i>text</i></p>
</div>
</div>
<div ng-repeat=""class="col-sm-3 album-art">
//loop to create the boxes
<div class="thumb">
<div class="box">
<span class="play" ng-click="">►</span>
<div class="overlay">
</div>
</div>
<img src= height="200" width="200"/>
<p style="">text heloooooooooooooooooooooooooooooooooooooooooo</p>
<p><i>text fffffffffffffffffffffffffffffffffffffffffffffffddddddddddddddsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssdddddddddddddddddddddddddddddddddddd fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</i></p>
</div>
</div>
</div>
<div class="row">
<div ng-repeat=""class="col-sm-3 album-art">
//loop to create the boxes
<div class="thumb">
<div class="box">
<span class="play" ng-click="">►</span>
<div class="overlay">
</div>
</div>
<img src= height="200" width="200"/>
<p style="">text helooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo</p>
<p><i>text</i></p>
</div>
</div>
<div ng-repeat=""class="col-sm-3 album-art">
//loop to create the boxes
<div class="thumb">
<div class="box">
<span class="play" ng-click="">►</span>
<div class="overlay">
</div>
</div>
<img src= height="200" width="200"/>
<p style="">text helooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo</p>
<p><i>text</i></p>
</div>
</div>
</div>
I tested what you did and it was working as intended. You used 1 row for the complete collection of cols, so they behaved as intended. To change that, you must force a grouping of cols and you can do it like this:
(Resume here:
- Add div class="col-sm-12" style="display: table" and close it after 4 of your "col-sm-3 divs". Add another one for the rest of the "col-sm-3 divs". Everything should be inside the div class="row". (I would have used two rows every 4 "col-sm-3 divs" but, is your code).
- Change the "style" into a css, include it in your stylesheet, add the class to the div. End.
.album-art {
padding-bottom: 20px;
padding-top: 20px;
margin-bottom: 10px;
}
.thumb {
position: relative;
}
.thumb .box {
position: absolute;
top: 0;
display: block;
width: 200px;
height: 200px;
text-align: center;
text-decoration: none;
cursor: pointer;
}
<!DOCTYPE html>
<html>
<head>
<title>Untitled Document</title>
<meta charset="UTF-8">
<meta name="description" content="">
<meta name="keywords" content="">
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<style>
.album-art {
padding-bottom: 20px;
padding-top: 20px;
margin-bottom: 10px;
}
.thumb {
position: relative;
}
.thumb .box {
position: absolute;
top: 0;
display: block;
width: 200px;
height: 200px;
text-align: center;
text-decoration: none;
cursor: pointer;
}
</style>
</head>
<body>
<div class="row">
<div class="col-sm-12" style="display: table;">
<div class="col-sm-3" style="padding-bottom: 20px; padding-top: 20px">
<div class="thumb">
<div class="box">
<span class="play"></span>
<div class="overlay"></div>
</div>
<img src="#" height="50" width="50" />
<p style="color: black">tedddddddxxxx ewhuiofhew hfiuhiufw shidfshksdhxfffffffffffffxxxxxddddddxt</p>
</div>
</div>
<div class="col-sm-3" style="padding-bottom: 20px; padding-top: 20px">
<div class="thumb">
<div class="box">
<span class="play"></span>
<div class="overlay"></div>
</div>
<img src="#" height="50" width="50" />
<p style="color: black">text</p>
</div>
</div>
<div class="col-sm-3" style="padding-bottom: 20px; padding-top: 20px">
<div class="thumb">
<div class="box">
<span class="play"></span>
<div class="overlay"></div>
</div>
<img src="#" height="50" width="50" />
<p style="color: black">text</p>
</div>
</div>
<div class="col-sm-3" style="padding-bottom: 20px; padding-top: 20px">
<div class="thumb">
<div class="box">
<span class="play"></span>
<div class="overlay"></div>
</div>
<img src="#" height="50" width="50" />
<p style="color: black">text</p>
</div>
</div>
</div>
<div class="col-sm-12" style="display: table;">
<div class="col-sm-3" style="padding-bottom: 20px; padding-top: 20px">
<div class="thumb">
<div class="box">
<span class="play"></span>
<div class="overlay"></div>
</div>
<img src="#" height="50" width="50" />
<p style="color: black">text</p>
</div>
</div>
<div class="col-sm-3" style="padding-bottom: 20px; padding-top: 20px">
<div class="thumb">
<div class="box">
<span class="play"></span>
<div class="overlay"></div>
</div>
<img src="#" height="50" width="50" />
<p style="color: black">text</p>
</div>
</div>
<div class="col-sm-3" style="padding-bottom: 20px; padding-top: 20px">
<div class="thumb">
<div class="box">
<span class="play"></span>
<div class="overlay"></div>
</div>
<img src="#" height="50" width="50" />
<p style="color: black">text</p>
</div>
</div>
<div class="col-sm-3" style="padding-bottom: 20px; padding-top: 20px">
<div class="thumb">
<div class="box">
<span class="play"></span>
<div class="overlay"></div>
</div>
<img src="#" height="50" width="50" />
<p style="color: black">text</p>
</div>
</div>
</div>
</div>
</body>
</html>