My current code snippet looks like this:
while ( $row = mysqli_fetch_assoc($result) ) {
echo '<div class="leaders" style="background-color:#ada30a;">' . $row['playername'];
echo "<br>";
echo $row['points']. '</div>';
}
Although each of the 3 total results are meant to have their own separate div box, they are all appearing stacked on top of each other. I attempted to add a margin-bottom in the CSS but it did not have the desired effect. You can see an example of the issue here: http://prntscr.com/i4ygm4 (there are 2 other boxes stacked underneath this one)
The CSS styling in question is as follows:
.leaders {
width:265px;
height:100px;
background-color: #ee845b;
margin-left: 900px;
padding: 10px;
text-align: right;
position: absolute;
margin-top: 40px;
margin-bottom: 500px;
color: white;
font-size: 20px;
border: 1px solid black ;
padding-top: 10px;
}
How can I go about resolving this stacking issue?
Thank you for your help!