我在我的网站上进行这项工作时遇到问题。我在 CSS 中有 3 列。我将 one_third 类用于前两列,将 one_third column_last 用于最后一列。我有多行:
<div class="one_third">
<img src="images/content/about-grow.jpg" alt="" />
<h4>Grow a Garden</h4>
<p>Sed posuere consectetur est at lobortis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed odio dui. sed.</p>
</div>
<div class="one_third">
<img src="images/content/about-wildlife.jpg" alt="" />
<h4>Protect Wildlife</h4>
<p>Sed posuere consectetur est at lobortis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed odio dui. sed.</p>
</div>
<div class="one_third column_last">
<img src="images/content/about-volunteer.jpg" alt="" />
<h4>Volunteer</h4>
<p>Sed posuere consectetur est at lobortis. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed odio dui. sed.</p>
</div>
这是我的 php.ini 文件。它现在只输出两列。我无法弄清楚如何正确输出最后一列。请帮忙!
<?
include("includes/connect.php");
$staff = mysql_query("SELECT * FROM programs ORDER BY title ASC");
$numrows=@mysql_num_rows($staff);
if($numrows != 0) {
while ($result_staff = mysql_fetch_array($staff)) {
?>
<?
if ($result_staff['image'] == "") {
?>
<div align="center" style="padding-bottom:2%" class="one_third">
<a href="images/content/<? echo $result_staff['image2']; ?>" class="fancybox" title="<? echo $result_staff['name']; ?>"><img src="images/content/<? echo $result_staff['image2']; ?>" alt="<? echo $result_staff['name']; ?>" border="1" /></a><br /><h4><? echo strtoupper($result_staff['title']); ?></h4><p><? echo $result_staff['content']; ?></p>
</div>
<? } else { ?>
<div align="center" style="padding-bottom:2%" class="one_third">
<a href="images/content/<? echo $result_staff['image']; ?>" class="fancybox" title="<? echo $result_staff['name']; ?>"><img src="images/content/<? echo $result_staff['image']; ?>" alt="<? echo $result_staff['name']; ?>" border="1" /></a><br /><h4><? echo strtoupper($result_staff['title']); ?></h4><p><? echo $result_staff['content']; ?></p>
</div>
<? } ?>
<? } } ?>