[英]How to upload all images when “overflow:hidden” is set for the uploaded area?
I try to write image gallery without use any libraries. 我尝试在不使用任何库的情况下编写图库。 I want to upload 14 jpg files as "uniq_image" instances into common image "moving_image".
我想将14个jpg文件作为“ uniq_image”实例上传到公共图像“ moving_image”中。 The bug that I succeed to upload only 3 jpg files because "overflow:hidden" is set for 'td' class in css.
我成功上传仅3个jpg文件的错误,因为在CSS中为“ td”类设置了“ overflow:hidden”。
The css file: css文件:
//the common long horizontal image that I want to assemble from uniq_images
#moving_image {
background-repeat: no-repeat;
position: relative;
border:1px dashed red;
width: 420px;
height: 130px;
left: 10px;
}
//the style for each uploaded image from the file
.uniq_image {
background-repeat: no-repeat;
border:1px solid gray;
width: 120px;
height: 80px;
margin: 5px 25px 5px 25px;
padding:2px
overflow:hidden;
}
//I set it because I have to fix the cell size
td {
overflow:hidden;
}
The html code: html代码:
....
<td width ="420" height="130" overflow="hidden">
<div id= "moving_image" >
<?php
$img_folder = 'picture';
$dir = dir($img_folder);
while (($file = $dir->read()) !== false){
echo '<img src="'.$img_folder."/".$file.'" class="uniq_image" >';
$dir->close();
?>
</div>
<td>
So, how can I fix this bug and upload all images into "moving_image"? 那么,如何解决此错误并将所有图像上传到“ moving_image”中? Thanks.
谢谢。
I solved this issue. 我解决了这个问题。 I added:
我补充说:
margin-left:-2000px;
width:2000px;
to "moving_image" definition. 到“ moving_image”定义。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.