HTML Notes Unit-4
HTML Notes Unit-4
INFORMATION TECHNOLOGY
DIGITAL NOTES
[Department of Computer Application]
SESSION 2024-25
HTML Elements
•
An ••HTML Element is a collection of start and end tags with the content inserted
between them. HTML elements are building blocks of web pages, representing
different types of content such as headings, paragraphs, links, and images.
What Are HTML Elements?
HTML (Hypertext Markup Language) is the backbone of web development. It allows
us to create structured and interactive web pages. In this article, we’ll learn about the
important aspects of HTML elements, their syntax, and best practices.
Syntax:
<tagname > Contents... </tagname>
Some key points about HTML elements
1. Syntax:
• An opening tag indicates where the content begins: <tagname>.
• A closing tag indicates where the content ends: </tagname>.
• The actual content resides between the opening and closing tags.
2. Case Sensitivity:
• HTML tags are not case-sensitive. For example, <B> and <b> both represent
bold text.
• However, it’s a best practice to use lowercase tags for consistency.
<head>
<title>HTML Elements</title>
</head>
<body>
<p>Welcome to GeeksforGeeks!</p>
</body>
</html>
Output:
<head>
<title>HTML Elements</title>
</head>
</body>
</html>
Output:
<head>
<title>HTML Elements</title>
</head>
<body>
<h2>Welcome To GeeksforGeeks</h2>
<p>Hi Geeks!
</body>
</html>
Output: This Image is showing the Browser’s Developer Tools and you can see that
the missing closing tag of the paragraph element in the above-written code is
automatically added by the browser without showing any error.
<head>
<title>Empty HTML Elements</title>
</head>
<body>
<h2>Welcome To GfG</h2>
<br />
<p>Hello Geeks.</p>
</body>
</html>
Output: