I need assistance with a code I created that generates 3 divs containing images and hyperlinks. The issue is that each div should have a padding-right of 200px, but my attempts to achieve this using CSS have been unsuccessful. As a result, the 3 divs are stacking on top of each other instead of having 200px of space between them. Any help would be greatly appreciated.
Code:
<?php
define('RANDOM_IMAGES_COUNT2',3);
define('RANDOM_IMAGES_FORMAT2', '<div id="rand%s" style="width:170px;height1px;float:left;text-align:center;top"><img src="%s" style="border-style:solid;border-width:2px;border-color:black;" /><a href="%s" alt="%s" title2="%s">%s</a></div>');
#------------------------------------------------------------------------------
$images = array (
array ( 'title2' => 'Test 2', 'src2' => 'pic2.jpg', 'href2' => 'http://mylink.com/path/','text2' => 'Hello' ),
array ( 'title2' => 'Test 2', 'src2' => 'pic7.jpg', 'href2' => 'http://mylink.com/path/','text2' => 'Hello2' ),
array ( 'title2' => 'Test 2', 'src2' => 'pic9.jpg', 'href2' => 'http://mylink.com/path/','text2' => 'Hello2' ),
array ( 'title2' => 'Test 2', 'src2' => 'pic5.jpg', 'href2' => 'http://mylink.com/path/','text2' => 'Hello2' ),
array ( 'title2' => 'Test 2', 'src2' => 'pic3.jpg', 'href2' => 'http://mylink.com/path/','text2' => 'Hello3' )
);
#------------------------------------------------------------------------------
if ( count($images) < RANDOM_IMAGES_COUNT2 ) {
trigger_error('Not enough images given', E_USER_WARNING);
exit;
}
#------------------------------------------------------------------------------
for ($i = 0; $i < RANDOM_IMAGES_COUNT2; $i++) {
shuffle($images);
$tmp = array_shift($images);
printf( RANDOM_IMAGES_FORMAT2,$i, $tmp['src2'], $tmp['href2'], $tmp['title2'], $tmp['title2'],$tmp['text2'] );
}
?>