I'm programming a website and I want four sections, then one below it aligned at the center.
On the site, there is a services section with 5 different services I want displayed. I am using PHP to pull the content from a MySQL database containing a services table with four rows and then filling in the boxes. I have tried changing the count number and arranging it a few different ways, but nothing seems to be working.
<div class="row pt-lg-3">
<div class="service-box col-md-1 col-sm-12 mt-lg-1 d-md-block d-none" style="max-width: 6%;"> </div>
<?php
include("mod_content/engine/qry_getservices.php");
$num_rows = mysql_num_rows($GetServices);
$counter = 0;
$class = 'fadeInLeft mb-4';
if($num_rows > 0){
while($row_services = mysql_fetch_array($GetServices)){
if($counter++ == 2){
echo '<div class="service-box col-md-1 col-sm-1 mt-lg-1"> </div>
<div class="service-box col-md-1 col-sm-12 mt-lg-1 d-md-block d-none" style="max-width: 6%;"> </div>';
$class = 'mt-lg-3 fadeInRight mb-3';
}
echo '<div class="service-box col-xl-5 col-lg-5 col-md-5 col-sm-12 wow animated mb-md-2 '.$class.'">';
if($row_services["Image"]!=""){
echo '<img src="'.$HTTPServerIP.'Photo/'.$row_services["Image"].'" alt="'.$row_services["Title"].'">';
} else{
echo '<img src="'.$HTTPServerIP.'images/blank-image.jpg" alt="'.$row_services["Title"].'">';
}
echo '<div class="service-box-inner">';
echo '<h4>'.$row_services["Title"].'</h4>';
echo "<br>";
echo '<p >'.$row_services["BriefDescription"].'</p>';
echo '<a title="View Details" href="'.$HTTPServerIP.'services/'.$row_services["ServiceID"].'">Read More</a>';
echo '</div>';
echo '</div>';
}
}
?>
I want it to create four boxes, but then have the fifth box centered below them. Right now, it appears as four boxes, then an off centered fifth box at the bottom.
Here is link to the site with current problem. It is in the services section. This is more of a question about alignment.