Kan iemand mij vertellen waarom de laatste child node (div class=voertuig) buiten de border van parent (div id=voorraadlijst) valt? Ik toon 5x(div class=voertuig), waarvan er 4 netjes binnen de border staan, en 1 erbuiten. Als er op de laatste pagina 2x(div class=voertuig) worden getoont, staat er 1 binnen de border...
Alvast bedankt

<!DOCTYPE HTML>

<?php

/**
 * @author Wim Kasius
 * @copyright 2013
 */

include ('dbconn.php');
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; };
$start_from = ($page-1) * 5;
$sql = "SELECT * FROM voertuigen ORDER BY merk ASC LIMIT $start_from, 5";
$rs_result = mysqli_query ($con,$sql);
?>
<head></head>
        <body>
            <div id="voorraadlijst" style="width: 450px; margin-left: 25%; margin-right: 25%; border-style: ridge; border-color: black; border-width: thin;">
            <?php
            while ($row = mysqli_fetch_assoc($rs_result)) {
                extract ($row);
                    $merkmodel = $row['merk']." ".$row['model'];
                $afbeeldingen = explode(",", $afbeeldingen);        
                  ?>
                          <div class="voertuig" style="clear: both;">
                                <div class="data" style="width: 50%; float: left;">
                                    <h3 class="merkmodel"><?php echo"$merkmodel"; ?></h3>
                                    <p class="type"><?php echo "$type"; ?> </p>
                                    <table>
                                        <tr><th>Bouwjaar</th><th>Kilometerstand</th></tr>
                                        <tr><td><?php echo "$bouwjaar";?></td><td> <?php echo "$tellerstand";?> km</td></tr>
                                    </table>
                                    <p>Vraagprijs: &euro; <?php echo "$verkoopprijs_particulier";?>,-</p>
                                </div>
                                <div class="fotos" style="width: 50%; float: right; margin-top: 10px;"><img class="voertuigfoto" style="width: 225px;" src=<?php echo current($afbeeldingen);?>>
                                </div>
                          </div>
            <?php }; ?>
            </div>
            <div id="navigatie" style="clear: both;">
                    <?php
                    $sql = "SELECT COUNT(hexon_nr) FROM voertuigen";
                    $rs_result = mysqli_query($con,$sql);
                    $row = mysqli_fetch_row($rs_result);
                    $total_records = $row[0];
                    $total_pages = ceil($total_records / 5);
                      
                    for ($i=1; $i<=$total_pages; $i++) { ?>
                                <a href='pagina.php?page=<?php echo $i;?>'>Pagina <?php echo $i;?></a>
                    <?php }; ?>
            </div>
        </body>
</html>


Broncheck:
<body>
<div id="voorraadlijst" style="width: 450px; margin-left: 25%; margin-right: 25%; border-style: ridge; border-color: black; border-width: thin;">
      <div class="voertuig" style="clear: both;">
            <div class="data" style="width: 50%; float: left;">
                <h3 class="merkmodel">Audi A1</h3>
                <p class="type">1.6 TDI 66KW SB S-TRONIC </p>
                <table>
                    <tr><th>Bouwjaar</th><th>Kilometerstand</th></tr>
                    <tr><td>2012</td><td> 9879 km</td></tr>
                </table>
                <p>Vraagprijs: &euro; 27999,-</p>
            </div>
            <div class="fotos" style="width: 50%; float: right; margin-top: 10px;"><img class="voertuigfoto" style="width: 225px;" src=http://images0.wheeler.nl/s1386081049/6911582-1-2-2.jpg>
            </div>
      </div>
      <div class="voertuig" style="clear: both;">
            <div class="data" style="width: 50%; float: left;">
                <h3 class="merkmodel">BMW 3 Serie</h3>
                <p class="type">318 D TOURING BUSINESS LINE </p>
                <table>
                    <tr><th>Bouwjaar</th><th>Kilometerstand</th></tr>
                    <tr><td>2008</td><td> 125653 km</td></tr>
                </table>
                <p>Vraagprijs: &euro; 12945,-</p>
            </div>
            <div class="fotos" style="width: 50%; float: right; margin-top: 10px;"><img class="voertuigfoto" style="width: 225px;" src=http://images0.wheeler.nl/s1386059922/6875896-1-2-2.jpg>
            </div>
      </div>
      <div class="voertuig" style="clear: both;">
            <div class="data" style="width: 50%; float: left;">
                <h3 class="merkmodel">Peugeot 206</h3>
                <p class="type">SW XS 1.4 </p>
                <table>
                    <tr><th>Bouwjaar</th><th>Kilometerstand</th></tr>
                    <tr><td>2003</td><td> 94444 km</td></tr>
                </table>
                <p>Vraagprijs: &euro; 3945,-</p>
            </div>
            <div class="fotos" style="width: 50%; float: right; margin-top: 10px;"><img class="voertuigfoto" style="width: 225px;" src=http://images1.wheeler.nl/s1386672743/6946173-1-2-2.jpg>
            </div>
      </div>
      <div class="voertuig" style="clear: both;">
            <div class="data" style="width: 50%; float: left;">
                <h3 class="merkmodel">Renault Scénic</h3>
                <p class="type">1.6 16V EXPRESSION LUXE </p>
                <table>
                    <tr><th>Bouwjaar</th><th>Kilometerstand</th></tr>
                    <tr><td>2003</td><td> 184137 km</td></tr>
                </table>
                <p>Vraagprijs: &euro; 2999,-</p>
            </div>
            <div class="fotos" style="width: 50%; float: right; margin-top: 10px;"><img class="voertuigfoto" style="width: 225px;" src=http://images1.wheeler.nl/s1386672377/6951187-1-2-2.jpg>
            </div>
      </div>
      <div class="voertuig" style="clear: both;">
            <div class="data" style="width: 50%; float: left;">
                <h3 class="merkmodel">Seat Arosa</h3>
                <p class="type">1.4 44KW 3D STELLA </p>
                <table>
                    <tr><th>Bouwjaar</th><th>Kilometerstand</th></tr>
                    <tr><td>2004</td><td> 76462 km</td></tr>
                </table>
                <p>Vraagprijs: &euro; 4245,-</p>
            </div>
            <div class="fotos" style="width: 50%; float: right; margin-top: 10px;"><img class="voertuigfoto" style="width: 225px;" src=http://images0.wheeler.nl/s1386239222/6928854-1-2-2.jpg>
            </div>
      </div>
</div>
<div id="navigatie" style="clear: both;">
            <a href='pagina.php?page=1'>Pagina 1</a>
            <a href='pagina.php?page=2'>Pagina 2</a>
</div>
</body>


Toevoeging op 15/12/2013 14:15:27:

never mind, noob float usage

Reageren