Kanbritech Learn logo
HTML HTML Tutorial 45h track

HTML Style Guide

Rewrite a cramped fragment with lowercase tags, quotes, and readable indentation.

Understand the topic

A consistent coding style helps people edit and review HTML. Use lowercase tag names, quote attribute values, indent nested content, and choose descriptive filenames. Include required alternative text and document metadata as part of normal authoring. Validate the markup when changing a complex structure. Consistency reduces mistakes, but valid meaning matters more than decorative formatting.

Worked example

<section class="course-summary">
  <h2>HTML foundations</h2>
  <p>Build a clear document before styling it.</p>
</section>

Two-space indentation shows nesting, and the class name describes a purpose. The section has a heading rather than being an unexplained wrapper.

Practice

Rewrite a cramped fragment with lowercase tags, quotes, and readable indentation.

Show a suggested answer
<div class="notice">
  <p>Class begins at ten.</p>
</div>

Common mistake

Do not mistake tidy formatting for valid HTML. Check nesting, unique IDs, and actual element content rules.

HTML documentation

Live Example

Try Coding

Result