Introduction:
- HTML Tags:
- HTML tags are the fundamental components that define the structure and presentation of web content. They are enclosed in angle brackets (<>) and consist of an opening tag and a closing tag. Let's explore some crucial HTML tags and their usage.
a) <html>
Tag:
The <html>
tag serves as the root element of an HTML document. It encapsulates all other elements and signifies the beginning and end of the HTML content.
Example:
html<html>
<!-- HTML content goes here -->
</html>
b) <head>
Tag:
The <head>
tag represents the container for metadata and other head elements, providing information about the HTML document. It includes elements such as the document title, character encoding, stylesheets, and more.
Example:
html<head>
<title>My Web Page</title>
<!-- Other metadata elements -->
</head>
c) <body>
Tag:
The <body>
tag contains the visible content of the web page. It encompasses text, images, links, and other elements displayed on the browser.
Example:
html<body>
<h1>Welcome to My Web Page</h1>
<p>This is the main content of the page.</p>
<!-- Other elements and content -->
</body>
d) <h1>
to <h6>
Tags:
Heading tags provide hierarchical structure to the page content, with <h1>
being the highest level and <h6>
the lowest. They are used to indicate headings and subheadings.
Example:
html<h1>Main Heading</h1>
<h2>Sub Heading</h2>
e) <p>
Tag:
The <p>
tag is used to define paragraphs of text on the webpage. It is one of the most commonly used tags for displaying blocks of text.
Example:
html<p>This is a paragraph of text.</p>
f) <a>
Tag:
The <a>
tag creates a hyperlink, allowing users to navigate to another webpage or a specific location within the same page.
Example:
html<a href="https://www.example.com">Visit Example.com</a>
g) <img>
Tag:
The <img>
tag is used to embed images into the web page. It requires the src
attribute, which specifies the image source (URL or file path).
Example:
html<img src="image.jpg" alt="Description of the image">
h) <ul>
and <li>
Tags:
The <ul>
tag represents an unordered list, while the <li>
tag defines each item within the list.
Example:
html<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
Conclusion: HTML tags are the building blocks that enable us to create visually appealing and structured web content. By understanding and utilizing these tags effectively, you can develop engaging web pages and embark on an exciting journey into web development. So, start
0 Comments