这是一个在 a 标签内没有视频的解决方案。 您可以在父级上使用 display: grid ,然后将后代放在同一行和同一列上。
<style>
div {
display: grid;
}
a, video {
width: 512px;
height: 288px;
grid-column: 1;
grid-row: 1;
}
a {
z-index: 1;
}
</style>
<div>
<a href="https://en.wikipedia.org/wiki/Vikings" target="_blank"></a>
<video width="512" height="288" controls>
<source src="Videos/Vikings_Short.mp4" type="video/mp4">
</video>
</div>