所以我有一些图像,当您点击时它们会变大。然而,当图像变大时,未被点击的图像移动到包含 div 的底部。示例:http://jsbin.com/losuniti/1/edit?html,css,output我怎样才能强制未点击的图像只停留在 div 的顶部?我试过使用
.images img { top: 0 !important; }
最佳答案
将 vertical-align:top 添加到图像 img 选择器:
.images img {
vertical-align:top;
display:inline-block;
position:relative;
top: 0 !important;}
我想这就是你想要的。
关于javascript - 将非事件图像保留在顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24691136/