我正在使用 Bootstrap 4 为朋友的个人网站制作一个模态画廊。我设置了它,以便图像在悬停时展开 - 但当我将溢出设置为自动时,它们会在模态(或 div)的边缘被切断。图库也是一组选项卡中的第三个,但所有这些都很好用。
我尝试更改哪个div具有overflow-auto类;我尝试过标记各种不同的标记,但无论我尝试什么,我都不知道如何制作它,以便图库滚动并且让我的图像在悬停时不会被切断。现在是相关代码:
.gallery {
overflow:visible !important;
z-index:999;
}
.gallery-img {
background-color:#ffeaf2;
height:10rem;
margin-left:0.5rem;
margin-top:0.5rem;
padding:0.3rem;
transition: transform .5s;
width:auto;
}
.gallery-img:hover {
box-shadow: 0 0 3px 3px #ffeaf2;
transform: scale(2);
z-index:999;
}
Gallery
![]()
![]()
![]()
![]()
如果需要更多信息,请告诉我!这是我第一次在这里发帖:)
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号