So i’m building a website and on one page i have a 3x12 video grid of many youtube videos. currently i have it so when there is a large screen it is 3 videos across. when it is a medium screen it shrinks down to 2 videos across and the videos slide down. small screen is 1 video across. the problem is when i have an odd number of videos, the last row at the bottom of the grid looks odd because it will have only 2 in the row with a large screen size, and 1 in the row with a medium screen. Is there a way to make it so if there is an odd number of videos for the page it will automatically center the last videos in the grid? I’m a newbie so easy with the technical terms please lol. thanks!
<div class="container-fluid">
<div class="row">
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='w38rpW_QBQA'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='xx418GwydNg'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='7C4VVfc6IKc'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='rnCn9Qw49ls'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='ICEAwQrNufk'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='BtP4Itw08ew'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='S2BjavO8IME'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='fjwylknK_m0'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='qP4aZVPCXn0'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='u03B9s4o7eA'></div>
</div>
<div class="col-lg-4 col-md-6 col-sm-12 video">
<div class='youtube-player' data-id='C8QI5lGhjz4'></div>
</div>
</div>
</div>
The css:
.videowrapper {
float: none;
clear: both;
width: 100%;
position: relative;
padding-bottom: 56.25%;
padding-top: 25px;
height: 0;
}
.youtube-player {
position: relative;
padding-bottom: 56.23%;
/* Use 75% for 4:3 videos */
height: 0;
overflow: hidden;
max-width: 100%;
background: #000;
margin: 5px;
}
.youtube-player iframe {
position: relative;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
background: transparent;
}
.youtube-player img {
bottom: 0;
display: block;
left: 0;
margin: auto;
max-width: 100%;
width: 100%;
position: absolute;
right: 0;
top: 0;
border: none;
height: auto;
cursor: pointer;
-webkit-transition: .4s all;
-o-transition: .4s all;
-moz-transition: .4s all;
transition: .4s all;
}
.youtube-player img:hover {
-webkit-filter: brightness(75%);
}
.youtube-player .play {
height: 72px;
width: 72px;
left: 50%;
top: 50%;
margin-left: -36px;
margin-top: -36px;
position: absolute;
background: url("http://i.imgur.com/TxzC70f.png") no-repeat;
cursor: pointer;
}```