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.
HTML Element | Descriptions |
---|---|
Opening tag(<tagname > ) | It is used to tell the browser where the content material starts. |
Closing tag(</tagname>) | It is used to tell the browser where the content material ends. |
Content | It is the actual content material inside the opening and closing tags. |
Combining all these 3 parts results in an overall HTML Element.
Example 1: In this example <p> is a starting tag, </p> is an ending tag and it contains some content between the tags, which form an element
<!-- HTML code to illustrate HTML elements -->
<!DOCTYPE html>
<html>
<head>
<title>HTML Elements</title>
</head>
<body>
<p>Welcome to w3wiki!</p>
</body>
</html>
Output:
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.