2. HTML Basic Structure
2. HTML Basic Structure
that define the overall structure and content of a web page. Here's a simple
HTML template:
<!DOCTYPE html>:
● Declares the document type and version of HTML. In modern HTML
(HTML5), this declaration is used.
<html lang="en">:
● Defines the root of the HTML document. The lang attribute specifies the
language of the document (e.g., "en" for English).
<head>:
● Contains meta-information about the HTML document, such as character
set, viewport settings, and the page title.
<meta charset="UTF-8">:
● Specifies the character encoding for the document. "UTF-8" is widely used
and supports a wide range of characters.
<meta name="viewport" content="width=device-width,
initial-scale=1.0">:
● Sets the viewport settings for responsive design. It ensures that the page
adapts to various device screen sizes.
<title>:
● Sets the title of the web page, which appears in the browser's title bar or
tab.
<body>:
● Contains the content of the HTML document, such as text, images, links,
and other elements.
<!-- Your content goes here -->:
● This is a comment, used to add notes to the code. You'll replace it with
your actual content.
Remember to customize the title tag with your page title and add your
content within the <body> tags. This basic structure provides a foundation
for building HTML documents.