HTML (Hypertext Markup Language) is the backbone of the World Wide Web. It is a markup language that is used to structure content on webpages. HTML is not a programming language; it is a markup language that defines the structure and layout of web documents, including text, images, links, forms, and more. In this tutorial series, we will learn the basics of HTML and how to create webpages using HTML tags.
HTML Documents: An HTML document is a plain text file with a ".html" extension. It contains a combination of text content and HTML tags, which are used to define the structure and elements on a webpage. HTML tags are enclosed in angle brackets, like <tagname>, and are used to specify elements like headings, paragraphs, links, and images.
HTML Elements: HTML documents consist of elements, which are the building blocks of a webpage. Elements are composed of an opening tag, content, and a closing tag. For example, here is a simple HTML paragraph element:
In this example, <p> is the opening tag, </p> is the closing tag, and "This is a paragraph of text." is the content of the paragraph.
Structure of an HTML Document: A typical HTML document has a specific structure:
In this example, href is the attribute, and "https://www.example.com" is its value.
HTML Documents: An HTML document is a plain text file with a ".html" extension. It contains a combination of text content and HTML tags, which are used to define the structure and elements on a webpage. HTML tags are enclosed in angle brackets, like <tagname>, and are used to specify elements like headings, paragraphs, links, and images.
HTML Elements: HTML documents consist of elements, which are the building blocks of a webpage. Elements are composed of an opening tag, content, and a closing tag. For example, here is a simple HTML paragraph element:
HTML:
<p>This is a paragraph of text.</p>
In this example, <p> is the opening tag, </p> is the closing tag, and "This is a paragraph of text." is the content of the paragraph.
Structure of an HTML Document: A typical HTML document has a specific structure:
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Document Title</title>
</head>
<body>
<!-- Content goes here -->
</body>
</html>
- <!DOCTYPE html>: This declaration defines the document type and version of HTML (HTML5 in this case).
- <html>: The root element that contains all other HTML elements on the page.
- <head>: Contains meta-information about the document, such as the title displayed in the browser tab.
- <title>: Sets the title of the webpage displayed in the browser.
- <body>: Contains the visible content of the webpage.
- <h1>, <h2>, <h3>, <h4>, <h5>, <h6>: Headings of different levels.
- <p>: Paragraphs of text.
- <a>: Links to other webpages or resources.
- <img>: Embeds images.
- <ul> and <ol>: Create unordered (bulleted) and ordered (numbered) lists.
- <li>: List items within lists.
- <table>: Defines tables for organizing data.
- <div>: A generic container for grouping and styling elements.
- <span>: A generic inline container for styling text or elements.
HTML:
<a href="https://www.example.com">Visit Example</a>
In this example, href is the attribute, and "https://www.example.com" is its value.