在CSS网格中使用video
时,我的文本.name
消失了,而在使用img
时不会发生
我已经建立了一个画廊,其中将显示项目:
<div class="project"> <!-- Project 11 -->
<video class="item" src="./images/motiondesign/11.mp4" alt="Project #11" controls loop>
<div class="name">
<h3>trippy</h3>
<p class="date">november 2019<p>
<p class="description">Lorem ipsum...</p>
</div>
</div>
<div class="project"> <!-- Project 10_2 -->
<img class="item" src="./images/motiondesign/10_2.png" alt="Project #10_2">
<div class="name">
<h3>sadness</h3>
<p class="date">november 2019<p>
<p class="description">Lorem ipsum...</p>
</div>
</div>
并按照以下格式在CSS中格式化它们(在网格内):
.gallery-site .container .gallery .project .item{
align-self: start;
grid-column-start: 1;
}
.gallery-site .container .gallery .project .name {
align-self: start;
grid-column-start: 2;
padding: 50px;
}
谢谢大家!