Tutorial HTML

HTML (Hyper Text Markup Language) is a markup language used to create web pages. HTML consists of a series of tags used to define various elements within an HTML document.

What is HTML?

HTML is a markup language used to create web pages. It consists of a series of tags used to define various elements within an HTML document.

HTML syntax

HTML syntax is used to create web pages. It consists of a series of tags used to define various elements within an HTML document.

Example

The following is an example of an HTML document:

<html lang="id">
    <head>
        <title>My first web page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
    </body>
</html>

HTML tags

HTML tags are used to define various elements within an HTML document.

Example

The following is an example of an HTML document with tags:

<html lang="id">
    <head>
        <title>My first web page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
    </body>
</html>

Explanation

  • <html lang="id"> is the root element of the document, and it contains all other elements.
  • <head> is an element that contains metadata about the document, such as the title, charset, and links to external stylesheets or scripts.
  • <title> is an element that sets the title of the page, which appears in the browser’s title bar and in search engine results.
  • <body> is an element that contains the content of the HTML document.
  • <h1> is an element that sets the first heading of the document.

HTML attributes

HTML attributes are used to add additional information to an element.

Example

The following is an example of an HTML document with an attribute:

<html lang="id">
    <head>
        <title>My first web page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
    </body>
</html>

Explanation

  • lang="id" is an attribute that specifies the language of the document.
  • title="My first web page" is an attribute that sets the title of the page.

HTML elements

HTML elements are used to define various elements within an HTML document.

Example

The following is an example of an HTML document with an element:

<html lang="id">
    <head>
        <title>My first web page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
    </body>
</html>

Explanation

  • <html> is an element that contains all other elements.
  • <head> is an element that contains metadata about the document, such as the title, charset, and links to external stylesheets or scripts.
  • <title> is an element that sets the title of the page, which appears in the browser’s title bar and in search engine results.
  • <body> is an element that contains the content of the HTML document.
  • <h1> is an element that sets the first heading of the document.

HTML comments

HTML comments are used to add additional information to an HTML document.

Example

The following is an example of an HTML document with a comment:

<!--
This is an example of an HTML document with a comment.
-->
<html lang="id">
    <head>
        <title>My first web page</title>
    </head>
    <body>
        <h1>Hello World!</h1>
    </body>
</html>

Explanation

  • <!-- This is an example of an HTML document with a comment. --> is a comment that is used to add additional information to an HTML document.

Table of contents