Ordered and Unordered Lists
Use ul when order does not matter, ol when sequence matters, and li for each list item. Lists make grouped information easier to scan.
Use ul when order does not matter, ol when sequence matters, and li for each list item. Lists make grouped information easier to scan.
Tables represent tabular data, not page layout. Use caption, th, and scope to help readers understand relationships between cells.
Forms collect user input. Labels should be associated with inputs using for and id, and each field should have a name for submission.
Browser validation can catch common mistakes with required, minlength, and type=email. Always validate again on the server when processing submissions.
Semantic elements describe meaning. Use header, nav, main, article, section, aside, and footer where appropriate, rather than using div for everything.
HTML describes the structure of a web page using elements. Browsers read these elements and display headings, paragraphs, links, and more.
A complete document has a doctype, html, head, and body. The head contains metadata; the body contains visible content.
Use h1 for the main page heading and h2–h6 for subsections. Paragraphs belong in p elements; heading levels should follow a logical outline.