A product page combines a readable name, features, price, and availability. The product information should make sense even before any design is applied.
What You Need to Know
Use lists for features and clearly label prices. HTML data can represent a machine-readable value, but it does not automatically connect the page to a store database.
Example: See It in Action
Try this markup in a fresh practice file. The next section explains the parts worth paying attention to.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<article>
<h1>Canvas Backpack</h1>
<p>Price: <data value="29.99">$29.99</data>
</p>
<ul>
<li>Water-resistant fabric</li>
<li>Two pockets</li>
</ul>
<p>Availability: In stock</p>
</article>
Let’s Understand the Example
- Article marks a piece that could make sense on its own, such as a news post or recipe.
- An h1 introduces the main subject of the page. Use the heading level for structure rather than font size.
- A p groups a paragraph of related text. Start another paragraph for a new thought.
- Value is the value represented or submitted by a control or data element.
You should see distinct list items. Ask whether their order carries meaning: if the order matters, use an ordered list; otherwise use an unordered list.
What Should You See?
The page should display “Canvas Backpack” as a heading, followed by its related content. Change the heading text and refresh the browser to see the result.
Read only the headings, from top to bottom. Do they tell a sensible story? If not, move sections or choose levels that match the content.
Try It Yourself
- Add product dimensions and a plain-text availability message.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Relying on color alone to show that a product is out of stock.
- Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.
Key Takeaways
- A product page combines a readable name, features, price, and availability.
- Article marks a piece that could make sense on its own, such as a news post or recipe.
- Use lists for features and clearly label prices. HTML data can represent a machine-readable value, but it does not automatically connect the page to a store database.