0

I've used flexbox to center a video on the page:

.pf-video-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

Now, I want to horizontally align text directly under this video. How can I accomplish this? In other words, how can I align the div I've called pf-video-text-container directly under the video? I want it to be left aligned directly under the video, not centered or anything like that.

Here is the relevant code:

    <div className="pf-main">
      <div className="pf-video-container">
        <ReactPlayer url="https://vimeo.com/475160747" controls />
      </div>
      <div className="pf-video-text-container">
        <p>Sembrando Lucha</p>
        <p>
          A small town confronts the expansion of an immigrant detention
          facility in their backyard. The struggle continues, support the
          community of McFarland by sharing and using our toolkit:
          bit.ly/GEOoutMcFarland
        </p>
      </div>
    </div>

The CSS:

.pf-main {
  border: 1px dashed black;
  width: 100%;
  font-size: 1.5rem;
}

.pf-video-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

This is what I have now: enter image description here

Here is an example of what I want: enter image description here

Jevon Cochran
  • 1,565
  • 2
  • 12
  • 23

2 Answers2

0

Try this and let me know if it worked

.pf-video-container,
.pf-video-text-container {
 width: 100%;
 display: flex;
 justify-content: center;
 text-align: left;
}
Dylan Anlezark
  • 1,256
  • 2
  • 12
  • 27
0

Use an impressive library of ready-made video players like

https://github.com/mediaelement/mediaelement

    <script src="mediaelement-and-player.min.js"></script>
    <script src="dist/jump-forward/jump-forward.js"></script>
    <script src="dist/skip-back/skip-back.js"></script>
    <script src="dist/speed/speed.js"></script>
    <script src="dist/quality/quality.js"></script>
    <script>
      var mediaElements = document.querySelectorAll('video, audio');

      for (var i = 0, total = mediaElements.length; i < total; i++) {

        var features = ['playpause', 'current', 'progress', 'duration', 'volume', 'skipback', 'jumpforward', 'speed', 'fullscreen'];

        new MediaElementPlayer(mediaElements[i], {
          autoRewind: false,
          features: features,
        });
      }
    </script>
<center>
    <div className="pf-main">
      <div className="pf-video-container">
         <video id="player1" class="video-js" preload="none" height="450" style= "width:93%;" controlsList="nofullscreen nodownload noremoteplayback" controls>
           <source src='https://vimeo.com/475160747' type="video/mp4" data-quality="HD">
                <p>
          A small town confronts the expansion of an immigrant detention
          facility in their backyard. The struggle continues, support the
          community of McFarland by sharing and using our toolkit:
          bit.ly/GEOoutMcFarland
              </p>
         </video>
      </div>
    </div>
<center>

.pf-main {
  border: 1px dashed black;
  width: 100%;
  font-size: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pf-video-container {
  width: 100%;
}