HTML (HyperText Markup Language) is a markup language used to create and structure web pages. It is the standard language for building websites and is essential to web development.
To create a basic HTML document, you will need to follow these steps:
- Open a text editor such as Notepad or Sublime Text.
- Type the following code:
<!DOCTYPE html> <html> <head> <title>My Website</title> </head> <body> <h1>Welcome to my website</h1> <p>This is a paragraph of text.</p> </body> </html>
- Save the file with a .html extension, for example, “index.html”.
- Open the file in a web browser to view the webpage.
Let’s break down the code:
<!DOCTYPE html>is a declaration that specifies the version of HTML being used.
<html>is the opening tag for the HTML document, and
</html>is the closing tag.
<head>contains information about the document, such as the title that appears in the browser’s title bar, and
</head>is the closing tag.
<title>is where you can specify the title of your webpage, and
</title>is the closing tag.
<body>is where you can include the content of your webpage, such as text, images, and links, and
</body>is the closing tag.
<h1>is a heading tag, and the number indicates the level of importance of the heading.
<h1>is the most important and
<h6>is the least important.
<p>is a paragraph tag, which is used for regular text.
You can add more HTML elements to your webpage to create a more complex structure. For example, you can add lists, tables, forms, and multimedia elements such as images and videos.
In summary, HTML is a markup language used to create web pages. By learning HTML, you can create your own websites and customize them to your liking.