Learn Web Development – The Super Simple Way

To learn web development you need to include CSS in your study agenda. The list we have is nice, I suppose, but it’s missing something.┬áLet’s style our list items. You can put your style inline for now. We’ll learn about style sheets later.

<ul>
  <?php
  $db = mysqli_connect("127.0.0.1", "root", "", "test");

  $result = $db->query("SELECT * FROM task");
  while ($row = $result->fetch_object()) {
    echo '<li style="list-style: none; border-bottom: 1px solid #cccccc;">' . $row->task_description . '</li>';
  }
  $result->close();
  $db->close();
  ?>
</ul>

Notice the new code we added in our <li> element. We added a style attribute with a value of what styles we wanted. We removed the list-style, or bullet point, and added a border-bottom, or bottom border of one pixel in size and gray.

You can learn more CSS from W3Schools.