Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 1.16 KB

File metadata and controls

64 lines (49 loc) · 1.16 KB

HTML Syntax

What HTML Does

  • HTML is used to structure a webpage and its content.
  • In the web stack:
    • HTML = structure/layout
    • CSS = style
    • JavaScript = logic

Basic Document Structure

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
</body>
</html>

Core Concepts

  • HTML tags wrap content.
  • Attributes provide extra information to a tag.
  • Attributes usually go in the opening tag.
  • You can inspect or view source in the browser to study HTML.
  • In VS Code, Ctrl + / comments out code.
  • Type ! and use Emmet to generate a starter HTML skeleton.
  • The Live Server extension is useful for previewing changes quickly.

Common Tags

Paragraph

<p>This is my paragraph content</p>

Headings

  • h1 is the most important heading.
  • h6 is the least important heading.
<h1>Most Important Heading</h1>
<h2></h2>
<h3></h3>
<h4></h4>
<h5></h5>
<h6>Least Important Heading</h6>

Links

  • Anchor tags create links using href.
<a href="https://google.com">Google</a>