HTML (HyperText Markup Language) uses elements to structure and display content. An HTML element is defined by a start tag, content, and an end tag. The tags are enclosed in angle brackets < >
.
Here are simple examples of HTML elements explained in an easy way:
Paragraph Element
<p>This is a paragraph.</p>
<p>
is the start tag for a paragraph.This is a paragraph.
is the content of the paragraph.</p>
is the end tag for a paragraph.
Heading Element
<h1>Welcome to My Website</h1>
<h1>
is the start tag for a top-level heading.Welcome to My Website
is the content of the heading.</h1>
is the end tag for a heading.
Image Element
<img src="image.jpg" alt="A beautiful scenery">
<img>
is a self-closing tag (it does not have an end tag).src="image.jpg"
specifies the source of the image.alt="A beautiful scenery"
provides alternative text for the image.
Link Element
<a href="https://www.example.com">Visit Example</a>
<a>
is the start tag for a hyperlink.href="https://www.example.com"
specifies the URL of the link.Visit Example
is the clickable text of the link.</a>
is the end tag for a hyperlink.
Unordered List Element
<ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>
<ul>
is the start tag for an unordered list.<li>
is the start tag for a list item.Item 1
is the content of the first list item.</li>
is the end tag for a list item.- The process is repeated for
Item 2
andItem 3
. </ul>
is the end tag for the unordered list.
Button Element
<button>Click Me!</button>
<button>
is the start tag for a button.Click Me!
is the content displayed on the button.</button>
is the end tag for a button.
These examples demonstrate the basic structure of HTML elements and how they are used to create various parts of a web page.