HTML (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 (Cascading Style Sheets) and JavaScript.

Basic Structure

The basic structure of an HTML document includes the following elements:

  • <!DOCTYPE html>: Declares the document type and version of HTML
  • <html>: The root element of an HTML page
  • <head>: Contains meta-information about the document
  • <body>: Contains the content of the document
<!DOCTYPE html>
<html>
<head>
    <title>Document Title</title>
</head>
<body>
    <!-- Content goes here -->
</body>
</html>

Elements

HTML elements are defined by tags. For example, the <h1> tag defines a top-level heading.

  • <h1>: Defines a top-level heading
  • <h2>: Defines a second-level heading
  • <h3>: Defines a third-level heading
  • <p>: Defines a paragraph
  • <a>: Defines a hyperlink

Attributes

Attributes provide additional information about elements. For example, the href attribute of the <a> tag defines the URL of the link.

<a href="https://www.example.com">Link Text</a>

Images

Images can be added to an HTML document using the <img> tag.

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

Example

Here is an example of a simple HTML page:

<!DOCTYPE html>
<html>
<head>
    <title>My Web Page</title>
</head>
<body>
    <h1>Welcome to My Web Page</h1>
    <p>This is a paragraph.</p>
    <a href="https://www.example.com">Visit Example</a>
    <img src="image.jpg" alt="A Description">
</body>
</html>

For more information, please visit our HTML Guide.