DEV Community

David Kanekanian
David Kanekanian

Posted on

E5 - Create Products Page

The products page shows customers the available products. For simplicity I will only list products by name.

1. Create an index.php page with html and body tags.

<html><body></body></html>
Enter fullscreen mode Exit fullscreen mode

2. Add a heading saying ‘Product Page’.

<h2>Product Page</h2>
Enter fullscreen mode Exit fullscreen mode

3. Add three products with a title and link to add it to the cart. The links won’t go anywhere yet.

<div> <span>Product #1</span> <a>Add to cart</a> </div>
Enter fullscreen mode Exit fullscreen mode

The final code:

<html><body>
    <h2>Product Page</h2>
    <div> <span>Product #1</span> <a>Add to cart</a> </div>
    <div> <span>Product #2</span> <a>Add to cart</a> </div>
    <div> <span>Product #3</span> <a>Add to cart</a> </div>
</body></html>
Enter fullscreen mode Exit fullscreen mode

Parent topic: Example 5

Top comments (0)