I find it's very strange. Even though it's working in HTML but not in PHP.
I will tell you the difference.
Here is JSFiddle for HTML.
And for PHP. The following code are below:
<div class="home-section">
<h1> BEST SELLER </h1>
<p>
<form method="POST" action="cart_update.php">
<ul class=\"home-section-img\">
<?php
include("config.php");
$current_url = base64_encode($url="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$results = $mysqli->query("SELECT * FROM products ORDER BY id ASC");
if ($results) {
while($obj = $results->fetch_object())
{
echo "<li>";
echo ' <a href="#">
<img src="images/'.$obj->product_img_name.'">
<p> '.$obj->price.' </p>
<p> '.$obj->product_name.' </p>
</a>';
echo "</li>";
}
}
?>
</ul>
</form>
</p>
</div>
I tried to convert from HTML to PHP. The result is display:inline-block;
doesn't work in PHP. but HTML works well for display:inline-block;
. The images in php should float left even though I am not using float:left;
, i just want to use display:inline-block;
So that I can insert pictures in database as many as I want. The images must be placed in the centered div. Any ideas?