0

I have a problem with my bs 4 carousel. I have video in it and I want it to be full width and height like in this link https://www.jeunesseglobal.com/ . Problem is that my video is in center and looks like this example

Here's my HTML

<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
    <div class="carousel-inner" role="listbox">
      <div class="carousel-item active">
        <video autoplay="true" loop muted class="d-block img-fluid" src="img/video.mp4" type="video/mp4">
      </div>
    </div>
  </div>

My CSS

video {
  width: 100vw;
  left: 0;
  right: 0;
}

I am bit lost whatever I do video is still in center and won't spread out

1 Answers1

0

CHANGES:

  1. Try a CSS reset
  2. Add some additional CSS to hide the scrollbars but still be able to scroll
  3. Add a closing </video> tag

video {
  width: 100vw;
  left: 0;
  right: 0;
}

#parent {
 overflow: hidden;
}

#carouselExampleSlidesOnly {
overflow-y: scroll;
}

::-webkit-scrollbar { 
    display: none; 
}


html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
 margin: 0;
 padding: 0;
 border: 0;
 font-size: 100%;
 font: inherit;
 vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
 display: block;
}
body {
 line-height: 1;
}
ol, ul {
 list-style: none;
}
blockquote, q {
 quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
 content: '';
 content: none;
}
table {
 border-collapse: collapse;
 border-spacing: 0;
}
<div id="parent">
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
    <div class="carousel-inner" role="listbox">
      <div class="carousel-item active">
        <video autoplay="true" loop muted class="d-block img-fluid" src="https://r1---sn-vgqs7nly.googlevideo.com/videoplayback?expire=1496618693&ratebypass=yes&lmt=1481043164463513&dur=59.350&pl=15&id=o-AL1AUoU6a3Nfcj7LH03aWUedATMzZser2fPJuYfXIks0&source=youtube&signature=4292002183801D0F3305E4F2C63F3CF53C6253E0.4BE60D1FB40096BD45D531BCDE2ECC2D39B0CDBA&key=cms1&mime=video%2Fmp4&requiressl=yes&ip=73.247.17.20&ei=ZEI0WcfDOoPPuALRm4-4DQ&sparams=dur,ei,expire,id,initcwndbps,ip,ipbits,itag,lmt,mime,mm,mn,ms,mv,pl,ratebypass,requiressl,source&ipbits=0&itag=22&redirect_counter=1&cm2rm=sn-vgqys7s&req_id=2b645fa084caa3ee&cms_redirect=yes&mm=34&mn=sn-vgqs7nly&ms=ltu&mt=1496597003&mv=m" type="video/mp4"></video>
      </div>
    </div>
  </div>
</div>
asportnoy
  • 2,218
  • 2
  • 17
  • 31