This tutorial aims to provide a basic understanding of HTML (HyperText Markup Language), its syntax, and its role in web development.
By the end of this tutorial, you should be able to:
Prerequisites: No prerequisites are required. This is a beginner-friendly tutorial.
HTML is the standard markup language for creating web pages. It allows us to structure our web page content using tags.
A basic HTML page structure looks like this:
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
<!DOCTYPE html>
: This is a declaration that informs the browser this document is written in HTML5.<html>
: This is the root element of the page.<head>
: Contains metadata about the page, such as the title.<title>
: The title of the web page, shown on the browser's title bar or tab.<body>
: This includes the main content of the web page.HTML tags are used to create HTML elements. Each tag has an opening (<tag>
) and a closing (</tag>
). For example, <h1>
is a heading tag, and </h1>
is its closing tag.
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
Let's create a basic HTML page with some content.
<!DOCTYPE html>
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My Web Page</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
When you open this in a browser, you'll see the title "My First Web Page" in the browser tab, and on the page, you'll see a headline saying "Welcome to My Web Page", followed by two paragraphs.
In this tutorial, we covered:
Next, you should learn about more complex HTML elements like lists, images, links, and tables. You can find more information and tutorials on Mozilla Developer Network (MDN)
You can use online HTML editors like JSFiddle or CodePen to practice. Happy coding!