HTML Tutorial

HTML Syntax

HTML Syntax

Every HTML program has rules for how statements are written and executed.

  • Documents start with <!DOCTYPE html>
  • Content lives inside <html>, <head>, and <body>
  • Elements use opening and closing tags
  • Attributes provide additional information

Example

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>
  <h1>My First Heading</h1>
  <p>My first paragraph.</p>
</body>
</html>
Try it Yourself