I am creating a social network that let's user posts statuses to their timeline.
When the status shows on their timeline, the username of the person who posted it shows next to the status. The username is on the left and the status is on the right(a few spaces away).
If the status is 5 lines long for example, the other status go down and therefore the username isn't aligned with the right status.
I tried fixing it, but nothing happened.
I don't know how to fix it, can someone help me ?
home.php:
<div class="w3-container">
<h2 style= "word-break: break-word;">
<?php
include("connect.php");
include("auth_login.php");
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//Write the query
$sql = "SELECT body FROM posts";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<p>".$row['body']. "</p>";
}
} else {
echo "No posts";
}
?>
</h2>
<h3>
<?php
//Write the query
$sql = "SELECT username FROM posts";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "<p>".$row['username']."</p>";
}
} else {
echo "";
}
$conn->close();
?>
</h3>
</div>
this is the problem I am having :