CMS Development

chrissa0000
Contributor

Vertically Align Videos

Hi! how do you automatically align the banner video that it always  goes to the middle position vertically and horizontally.  In all type of device

 

This is the module layout:

vertical video.PNG Sample page: 

https://info.besocialscene.com/brand-building-and-venues-0?hs_preview=QOMwBtWb-6657620457

0 Upvotes
1 Reply 1
MitchL
Participant

Vertically Align Videos

If you're okay with using flexbox, this is what I've been using lately:

 

@media(min-width: 767px){
.equal-cols> .row-fluid-wrapper > .row-fluid {
display: flex;
}

.flex-alignxy {
display: flex !important;
align-items: center;
justify-content: center;
}
}

 

 

Screen Shot 2018-11-30 at 9.28.54 AM.png

 

The jist of what happens is that applying the "equal-cols" class makes the children columns have an equal height. Then applying the "flex-alignxy" class to the children columns aligns their content both horizontally and vertically. 

 

As well, I wrapped the css in a media query so that it won't apply on mobile devices so that the elements will still be responsive.