简体   繁体   English

在div中预览多张图片时出错

[英]Error previewing multiple images inside div

I am uploading multiple images from a single input box and want user to see a thumb preview before uploading image to server. 我正在从一个输入框上传多个图像,并希望用户在将图像上传到服务器之前先看到一个缩略图预览。

My problem is the thumb previews are being shown outside DIV, like this: 我的问题是拇指预览在DIV之外显示,如下所示:

在此处输入图片说明 How do I make those thumbs appear inside the dark area? 如何使那些拇指出现在黑暗区域内?

My jsfiddle code is here . 我的jsfiddle代码在这里

我需要的输出样式

div#uploa by default have a display property set to block, wich meens any added element will be set below the div, so what you need to do, is to set position of the div to relative, then the position of the images to absolute, then control the left property using javascript. div#uploa默认情况下将display属性设置为block,这意味着将在div下方设置任何添加的元素,因此,您需要做的是将div的位置设置为相对,然后将图像的位置设置为绝对,然后使用javascript控制left属性。

this is exactly the element you need to target 这正是您需要定位的元素

output#list {
   position: absolute;
   top: 10;
   left: 230;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM