Jump to content

keep thumnails insdie container


thriller372

Recommended Posts

I have created a container & it displays the contents of a folder (images) as thumbnails but the  thumbnails display outside the container. So is there anyway I can keep the thumbnails inside the container. I can display seven thumbnails inside the container but then I need to start a new line to keep within the container. Appreciate any help

 

<!DOCTYPE html>
<html lang="en">
    <head>
    <meta charset="utf-8" />
    <title>Basic Demo</title>         
    </head>
    <body>
    <!-- start container !-->
    <div style="position:absolute;left:27%;top:19%;width:640px;height:543px;border:1px solid #A1BADA;border-radius: 15px;background: #DFDFDF;z-index:-1;"></div>
    <!-- end container !-->
<style>
div.numstyle {
position: absolute; top:25%; left:28%;font-size:40px;clear:both;
}

img {
    display: inline-block;
    margin: 15px 15px 15px 15px;
    max-width: 60px;
    height: auto;
    outline: outset;
    }
img:active {
    max-width: 15%;
}
</style>       
   
   <div class="numstyle">
     
<?php
$folder = 'images/';
$filetype = '*.*';
$files = glob($folder.$filetype);
$count = count($files);

for ($i = 0; $i < $count; $i++) {
    echo '<tr><td>';
    echo '<a name="'.$i.'" href="#'.$i.'"><img src="'.$files[$i].'" /></a>';
   
    echo '</td></tr>';
}
?>
    
   </div>
   </body>
   </html>

I'm not worried that it's not pretty I just need to know if there's a way of solving this problem. Thanks

Link to comment
https://forums.phpfreaks.com/topic/294862-keep-thumnails-insdie-container/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.