Basic Tags in HTML Language
HTML (Hypertext Markup Language) is the foundation of every webpage on the internet. It’s a markup language that structures the
content on a webpage using a variety of tags. Understanding the basic HTML tags is essential for anyone looking to create and design web content. In this post, we’ll explore some of the fundamental HTML tags, along with examples to help you get started.- Declaration
The <!DOCTYPE>
declaration is the very first tag in an HTML document. It tells the browser which version of HTML the page is using. For modern web development, it usually looks like this:
<!DOCTYPE html>
- Tag
The <html>
tag is the root element of an HTML document, and all other HTML elements are nested inside it. Here’s what it looks like:
<html>
<!-- Your webpage content goes here -->
</html>
- Tag
The <head>
tag contains metadata about the document, such as the title of the webpage and links to external resources like stylesheets and scripts.
<head>
<title>My Webpage</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
- Tag
The <body>
tag holds the visible content of your webpage, including text, images, links, and more.
<body>
<h1>Welcome to My Webpage</h1>
<p>This is a simple example of HTML content.</p>
</body>
- to Tags
HTML provides six levels of heading tags, from <h1>
(the highest) to <h6>
(the lowest). They are used to define the structure and hierarchy of your content.
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Another Subheading</h3>
- Tag
The <p>
tag is used to create paragraphs of text on your webpage.
<p>This is a paragraph of text. It can contain any content you want.</p>
The <a>
tag is used to create hyperlinks. You specify the URL you want to link to using the href
attribute.
<a href="https://www.example.com">Visit Example.com</a>
- Tag (Image)
The <img>
tag is used to display images on your webpage. You specify the image source using the src
attribute.
<img src="image.jpg" alt="Description of the image">
-
- Tags (Unordered List)
To create bulleted lists, you can use the <ul>
and <li>
tags. <ul>
defines the unordered list, and <li>
defines each list item.
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
Discover more from PiEmbSysTech
Subscribe to get the latest posts sent to your email.