HTML Is a (HyperText Markup Language) for creating and designing Web pages with different elements.
In HTML, elements are typically defined by a start tag, which is the opening part of the element. <>
Example: an opening tag and a closing tag.
- Opening tag: The opening tag that defines the beginning of the element. <>
- Content: The information or data contained within the element.
- End Tag: The closing tag has same text as the opening tag, but has an additional forward-slash ( / ).
<h1>My First Heading</h1>
<p>My first paragraph.</p>
As i said, The Opening tag is written with angle brackets <> and contains the element's name. Look at example
Start tag | Element content | End Tag |
---|---|---|
<h1> | My First Heading | </h1> |
Basic HTML Structure
The basic structure of an HTML document is designed to be simple and to provide a clear framework for adding content
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Example</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Explanation:
In a HTML document, the root elements <html> divided into two main sections: <head> and <body>.
- The
<head>
element is used to contain metadata and other information about the document that isn't directly visible on the web page. - The <body> element contains the actual content that users see and interact with on the web page.
More Details:
- <!DOCTYPE html>: This declaration defines the document type and version of HTML being used (HTML5 in this case).
- <html lang="en">: This is the root element of the HTML document that wraps the entire HTML content. The lang attribute specifies the language of the document.
- <head>: Contains meta-information about the document, such as the title and any linked CSS or JavaScript files
- <meta charset="UTF-8">: Specifies the character encoding for the document (UTF-8 is a common choice).
- <meta name="viewport" content="width=device-width, initial-scale=1.0">: Ensures the page is responsive and scales correctly on different devices.
- <title>: Sets the title of the document, which will be displayed in the web browser's title bar or tab.
- <body>: The <body> element contains the actual content that users. including text, Headings, Videos, Images, Links and other all elements and data.
Customizing Your HTML:
You can customize the title, headings, and paragraphs to fit your needs. For example, changing <title>From Example</title> to <title>My First Website</title>
will update the browser tab title to "My First Website."
Feel free to expand this basic structure by adding more elements such as images, links, lists, and other HTML tags as needed for your project.
Thanks!