我有代码让我的图像(最终是视频)居中,就像我希望在 div 中一样,但我试图让图像垂直堆叠在一列中。
如果空间足够狭窄,它会起作用,但我希望它一直起作用。我能做些什么?这是我的代码笔:
div{
margin: 0 auto;
height: 100vh;
text-align: center;
overflow: hidden;
max-width: 172vh;
}
img{
height: 50%;
}
最佳答案
尝试以下:
div {
....
display: flex;
flex-direction: column;
}
关于html - 垂直堆叠图像/视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59205927/