如何将此视频置于包含它的 DIV 中?
.courses-container {
display: table-cell;
width: 100%;
background-color: #00ffd0;
}
.courses-col{
float: left;
width: 50%;
}
@media only screen and (max-width: 500px) {
.courses-col {
float: left;
width: 100%;
}
}
center {
text-align: center;
}
<div class="courses-container">
<div class="courses-col">
<br>
<video class="center" width="80%" autoplay controls loop>
<source src="Video URL" type="video/mp4">
Your browser does not support the video tag.
</video>
<br><br>
</div>
<div class="courses-col">
<br>
<p>Text</p>
<br>
</div>
</div>
我只需要能够将显示在文本左侧的视频居中。鉴于它在 DIV 中,我该怎么做?
最佳答案
只需添加:
video.center {
margin: auto;
display: block;
关于html - 将视频置于 DIV 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49909735/