Getting Started

HTML or Hypertext Markup Language is the main language for creating and structuring webpages. It uses tags for formatting elements and is commonly combined with CSS and JavaScript.
  • HTML stands for HyperText Markup Language.
  • It structures and organizes content on web pages.
  • HTML consists of elements that form the basic building blocks of web pages.
  • These elements structure content, form the page layout, and create the DOM (Document Object Model).
  • It governs how text, images, and multimedia are displayed on web pages.

Why Use HTML?

HTML is the foundational markup language for creating websites. It outlines the sections of a page, such as headers, footers, and sidebars, and arranges elements within those sections. HTML is critical for organizing and constructing the content of a webpage.

A Simple HTML Document

My First Heading

My first paragraph.

index.html
<!DOCTYPE html>
<html>
<head>
  <title>Web Page Title</title>
</head>
<body>
  <h1>My First Heading</h1>
  <p>My first paragraph.</p>
</body>
</html>

Example Breakdown

  • The <doctype> declaration indicates that the document follows the HTML5 standard.
  • The <html> tag represents the root of the HTML document.
  • The <head> tag contains metadata about the page.
  • The <title> tag defines the page title, which appears in the browser's title bar or tab.
  • The <body> tag holds the main content of the page, such as text, images, links, and more.
  • The <h1> tag defines a primary heading.
  • The <p> tag creates a paragraph of text.

Getting Started with HTML

HTML is divided into 12 sections, covering topics from beginner to advanced, making it easier to learn. This structure helps you understand when and how to use different tags and attributes effectively.

What is an HTML Element?

An HTML element consists of an opening tag, content, and a closing tag:
<tagname> Content here... </tagname>
An element includes everything from the opening to the closing tag.

Start tagElement contentEnd tag
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<br>nonenone
Some HTML elements are self-closing (like the <br> tag), meaning they do not require an end tag!

Why Learning HTML is Important

Learning HTML is essential for anyone interested in web development, as it forms the core structure of any webpage. Here are some things that require HTML:

  • Paragraphs: Paragraphs are created using the <p> tag, helping to organize text clearly on a webpage.
  • Headings: HTML provides six levels of headings from <h1> to <h6>, with <h1> being the most important.
  • Block Elements: These elements create a new line or block of space by default, such as <div>, <p>, and <table>.
  • Line Breaks: Line breaks, created by the <br> element, allow you to control the layout by separating sections of content.

HTML Basics

Before diving into more advanced topics, it’s important to familiarize yourself with the basics of HTML. Key concepts include editors, tags, elements, attributes, headings, paragraphs, and basic formatting.

Conclusion

HTML (HyperText Markup Language) is the fundamental language used to structure and display content on web pages. It organizes text, images, and multimedia into a coherent layout, forming the basis of web page creation. Key HTML elements include tags such as <h1> for headings, <p> for paragraphs, and self-closing tags like <br> for line breaks.