CSS in php XML Paser for loop



I've got an RSS XML Displayer which gets elements with a for loop from an XML Rss feed as follows:



//get and output "<item>" elements
$x=$xmlDoc->getElementsByTagName('item');

//iterate though all of the feed

for ($i=0; $i<=$x->length-1; $i++) {
echo ("<div class='boxed'>");
$item_title=$x->item($i)->getElementsByTagName('date')
->item(0)->childNodes->item(0)->nodeValue;
$item_link=$x->item($i)->getElementsByTagName('location')
->item(0)->childNodes->item(0)->nodeValue;
$item_desc=$x->item($i)->getElementsByTagName('report')
->item(0)->childNodes->item(0)->nodeValue;
echo ("<p><a href='" . $item_link
. "'>" . $item_title . "</a>");
echo ("</div>");
echo ("<br>");

echo ($item_desc . "</p>");
}


?>


I'd like to modify this using css so each element is seperated in a 'box' via CSS. I'm sure this is possible but cannot figure out how to do it. The CSS intuitively needs to be implemented within the for loop. How to implement that?


No comments:

Post a Comment