HTML, which stands for HyperText Markup Language, is the standard markup language for documents designed to be displayed in a web browser. It can be assisted by technologies such as CSS and JavaScript.

Basic Structure

Here is a simple HTML document structure:

<!DOCTYPE html>
<html>
<head>
  <title>Page Title</title>
</head>
<body>

  <h1>This is a Heading</h1>
  <p>This is a paragraph.</p>

</body>
</html>

Elements and Tags

  • Elements are the building blocks of HTML. They tell the browser about the type of content on the page.
  • Tags are used to define elements. They come in pairs: an opening tag and a closing tag.
<h1>Heading</h1>
<p>Paragraph</p>

Document Type Declaration

The document type declaration (DOCTYPE) defines the document type and version of HTML. For HTML5, it is:

<!DOCTYPE html>

Headings

HTML headings are defined with the <h1> to <h6> tags. <h1> is the highest level and <h6> is the lowest level.

Paragraphs

Paragraphs are defined with the <p> tag.

Links

To create a hyperlink, use the <a> tag with the href attribute.

<a href="https://www.example.com">This is a link</a>

Images

To insert an image, use the <img> tag with the src attribute pointing to the image source.

<img src="image.jpg" alt="Description of the image">

HTML Image

Lists

HTML lists include ordered lists (<ol>) and unordered lists (<ul>).

Ordered List

<ol>
  <li>First item</li>
  <li>Second item</li>
</ol>

Unordered List

<ul>
  <li>First item</li>
  <li>Second item</li>
</ul>

Tables

Tables are defined with the <table> tag, and rows with <tr>. Cells are defined with <td> or <th> for headers.

<table>
  <tr>
    <th>Header 1</th>
    <th>Header 2</th>
  </tr>
  <tr>
    <td>Data 1</td>
    <td>Data 2</td>
  </tr>
</table>

Forms

Forms are used to collect user input. They are defined with the <form> tag and can include input elements like <input>, <textarea>, and <select>.

<form action="/submit_form" method="post">
  <label for="name">Name:</label>
  <input type="text" id="name" name="name">
  <input type="submit" value="Submit">
</form>

For more information on HTML, visit our HTML Tutorial.