Bit of a odd one I have started pulling in images from facebook as a li they display fine down the page however if i float them left the background colour of the containing div disappears ??
CSS
any ideas?
PHP:
<div id="page">
<div class="content">
<div id="pagetitle">Gallery</div>
<div class="left">
<div id="mainContentgallery">
<?php
//Set the page name or ID
$FBid = '##############';
//Get the contents of a Facebook page
$FBpage = file_get_contents('https://graph.facebook.com/'.$FBid.'/photos');
//Interpret data with JSON
$photoData = json_decode($FBpage);
foreach ( $photoData->data as $data )
{
echo '<li><img src="https://graph.facebook.com/'.$data->id.'/picture/" />';
echo '<br />'.$data->name.'</li>';
}
?>
</div>
</div>
<div class="right">
<div id="twitter"></div>
<!--<div id="advert"></div>-->
</div>
<div class="clear"></div>
</div>
</div>
CSS
Code:
/**gallery only**/
div.left div#mainContentgallery {
font-family: 'Crafty Girls', cursive;
font-weight: normal;
font-size: 10px;
width:650px;
background-color:#FCF5D7;
margin:20px;
margin-right:0;
}
div.left div#mainContentgallery img {
height:150px;
width:150px;
}
div.left div#mainContentgallery li {
float:left; /** This loses the background colour from maincontentgallery div**/
padding:20px;
padding-right:20px;
list-style: none;
width:150px;
}
any ideas?